...
As soon as the NXP i.MX RT1050 EVK board is powered on or reset, the i.MX RT1050 proceeds to boot the U‑Boot firmware from the SD Card printing the following output to the serial console:
Code Block |
---|
U-Boot SPL 2022.04 (Sep 25 2023 - 08:16:21 +0000) |
...
Trying to boot from MMC1 |
...
U-Boot 2022.04 (Sep 25 2023 - 08:16:21 +0000) |
...
DRAM: 32 MiB |
...
Core: 71 devices, 13 uclasses, devicetree: separate |
...
MMC: FSL_SDHC: 0 |
...
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 RT1050 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
- print the value of the variable<var>
. Without arguments, prints all environment variables:Code Block => printenv
addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off
arch=arm
baudrate=115200
board=imxrt1050-evk
board_name=imxrt1050-evk
bootcmd=run mmcboot
bootdelay=1
cpu=armv7m
ethact=ethernet@402D8000
ethaddr=aa:bb:cc:dd:ee:f0
fdtcontroladdr=81e85ea0
fileaddr=80007fc0
filesize=8062b8
gatewayip=192.168.1.254
image=rootfs.uImage
ipaddr=192.168.1.98
loadaddr=0x80007fc0
mmc_update_kernel=tftp ${tftpdir}${image} && fatwrite mmc 0 ${loadaddr} ${image} ${filesize}
mmc_update_spl=tftp ${tftpdir}${spl} && setexpr tmp ${filesize} / 0x200 && setexpr tmp ${tmp} + 1 && mmc write ${loadaddr} 2 ${tmp}
mmc_update_uboot=tftp ${tftpdir}${uboot} && setexpr tmp ${filesize} / 0x200 && setexpr tmp ${tmp} + 1 && mmc write ${loadaddr} 0x100 ${tmp}
mmcboot=fatload mmc 0 ${loadaddr} ${image} && run addip && bootm ${loadaddr}
netboot=tftp ${tftpdir}${image} && run addip && bootm
netmask=255.255.0.0
serverip=192.168.1.96
soc=imxrt
spl=SPL
splashimage=0x80007fc0
splashsource=mmc_fs
stderr=serial
stdin=serial@40184000
stdout=serial
tftpdir=imxrt1050/
uboot=u-boot.img
vendor=freescale
Environment size: 1113/126972 bytes
setenv <var> <val>
- set the variable<var>
to the value<val>
:Code Block => setenv image my.rootfs.uImage
=>
saveenv
- save the up-to-date U-Boot environment, possibly updated using setenv commands, into the SD Card. Runningsaveenv
makes sure that any updates you have made to the U-Boot environment are persistent across power cycles and resets.Code Block => saveenv
Saving Environment to MMC... Writing to MMC(0)... OK
=>