Running U-Boot Print


As explained in Installing U-Boot to the NXP i.MX RT1024 EVK board, you have to install U-Boot to the SD Card of the NXP i.MX RT1024 EVK board in order to run Linux (uClinux) on the NXP i.MX RT1024 EVK board. U-Boot runs as the primary firmware from the SD Card on each power-on / reset.

U-Boot is probably the most popular firmware monitor for Linux. It is developed and maintained by DENX Software Engineering ( If you need detailed information on any aspects of U‑Boot operation, DENX publishes extensive U‑Boot user documentation at their web site.

U-Boot for the i.MX RT1024 microcontrollers is consisted of the two parts: SPL and TPL. SPL is installed with a 1k offset, TPL with a 128k offset in the SD card.

When SW8 switch selects the SD Card as a source boot, then the i.MX RT1024 ROM bootloader reads the SPL image at 0x400 offset from the start of the SD Card device and runs it. Then, SPL initializes SDRAM, read TPL from the SD card and runs it. TPL relocates itself to the end of the SDRAM, before the NON-Cached region, which is reserved for DMA, and is subsequently executed from there. Volatile data (stack, variables, dynamic pool) are maintained in the external SDRAM memory as well.

As soon as the NXP i.MX RT1024 EVK board is powered on or reset, the i.MX RT1024 proceeds to boot the U‑Boot firmware from the SD Card printing the following output to the serial console:

U-Boot SPL 2022.04 (Jul 03 2023 - 09:52:07 +0000)
Trying to boot from MMC1

U-Boot 2022.04 (Jul 03 2023 - 09:52:07 +0000)

DRAM: 32 MiB
Core: 59 devices, 13 uclasses, devicetree: separate
Loading Environment from MMC... OK
In: serial@40184000
Out: serial@40184000
Err: serial@40184000
Net: eth0: ethernet@402D8000
Hit any key to stop autoboot: 0

If you hit any key on the serial console before the number of seconds defined by the U-Boot bootdelay variable has elapsed, you will enter the U-Boot interactive command monitor. From the command monitor you can run U‑Boot commands to examine memory, load an image from Ethernet, boot Linux from a loaded image or perform any other action supported by U-Boot.

U-Boot makes use of the so-called environment variables to define various aspects of the target functionality. On the NXP i.MX RT1024 EVK board, the U-Boot environment is stored at offset 512k also in the SD card.and is persistent across power or reset cycles. Parameters defined by the U-Boot environment variables include: target IP address, target MAC address, location in RAM where a Linux bootable image will be loaded, and many others.

To manipulate the U-Boot environment the following commands are used:

  • printenv <var> - print the value of the variable <var>. Without arguments, prints all environment variables:
  • => printenv
    addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
    bootcmd=run mmcboot
    mmcboot=fatload mmc 0 ${loadaddr} ${image} && run addip && bootm ${loadaddr}
    netboot=tftp ${image} && run addip && bootm

    Environment size: 639/126972 bytes

  • setenv <var><val> - set the variable <var> to the value <val>:
  • => setenv image my.rootfs.uImage

  • saveenv - save the up-to-date U-Boot environment, possibly updated using setenv commands, into the SD Card. Running saveenv makes sure that any updates you have made to the U-Boot environment are persistent across power cycles and resets.
  • => saveenv
    Saving Environment to MMC... Writing to MMC(0)... OK