

The -s option allows to specify the size of the image to create. tools/mkenvimage -s 0x4200 -o uboot-env.bin uboot-env.txt With mkenvimage you can write a text file uboot-env.txt describing the environment, like: This utility has been merged into the U-Boot Git repository (see the commit) and will therefore be part of the next U-Boot release. For all of these cases, having a binary environment image is desirable.ĭavid Wagner, who has been an intern with us at Bootlin from April to September 2011, has written a utility called mkenvimage which just does this: generate a valid binary environment image from a text file describing the key=value pairs of the environment. Or, in factory, initial flashing of devices typically takes place either through specific CPU monitors, or through a JTAG interface.
#U boot bin serial#
For example, on AT91 devices, the SAM-BA utility provided by Atmel is capable of completely reflashing an AT91 based system connected through the serial port of the USB device port. While this environment can easily be manipulated from U-Boot or from Linux using the above mentioned commands, it is sometimes desirable to be able to generate a binary image of an environment that can be directly flashed next to the bootloader, kernel and root filesystem into the device’s flash memory.


The environment is basically stored as a sequence of null-terminated strings, with a little header containing a checksum at the beginning. This environment is typically stored in a specific flash location, defined in the board configuration header in U-Boot. This bootloader stores its configuration into an area of the flash called the environment that can be manipulated from within U-Boot using the printenv, setenv and saveenv commands, or from Linux using the fw_printenv and fw_setenv userspace utilities provided with the U-Boot source code. Many embedded devices these days use the U-Boot bootloader.
