Working with U-Boot tools requires that the environment has been saved with the saveenv command from U-Boot prompt, otherwise the U-Boot tools are using the default environment.
If redundant environment is configured the saveenv command must be executed twice to write the the second environment.

U-Boot provides two tools to read fw_setenv and edit fw_printenv the U-Boot environment from the Linux shell. The U-Boot tools are selected by default in the BSP's. This tutorial describes how to setup the configuration file and the usage of these tools.

The U-Boot Tools need a proper configuration in /etc/fw_env.config. The memory offset and environment size have to be configured in the config file.
In case of a unmanaged memory (e.g. SPI NOR) the block size also has to be configured. The example configurations below refers to the default partitioning of our BSP's.

TQMa7x

TQMa6UL

TQMa6x

TQMa28

TQMLS102xA

Read U-Boot Environment
fw_printenv
Edit U-Boot Environment
fw_setenv [parameter] [value]

Example

Disclaimer
TQ-Systems GmbH provides the Board Support Packages (BSP) free of charge. The software included in the shipment has been configured individually for the starter kits. The software is only intended to evaluate the module. The use of the Board Support Packages (BSP) is only allowed within the scope of functionality described by TQ-Systems GmbH. TQ-Systems GmbH does not accept any liability for all further changes of the Board Support Package and for any damage resulting from its use.