Building and Self-Updating U-Boot on the NXP i.MX RT1170 EVK Board Print


Installing U-Boot to the NXP i.MX RT1170 EVK board explains how to install the U-Boot firmware to the board for the first time. Having installed U-Boot, U-Boot is immediately available on the i.MX RT1170 as a primary firmware monitor.

The default U-Boot configuration is a capable Linux bootloader so typically our customers do not require re-building and re-installing U-Boot. However, certain projects still do require customizations to the U-Boot firmware, which implies making changes to the U-Boot code, rebuilding the U-Boot binary and then updating it on the i.MX RT1170.

The full U-Boot source for the NXP i.MX RT1170 EVK board is included in the software distribution available from the Emcraft web site. Refer to the u-boot/ sub-directory in the software distribution tree.

The key board specific-configuration files for the NXP i.MX RT1170 EVK board are as follows:

  • u-boot/configs/mxrt117x-evk_defconfig - default U-Boot configuration;
  • u-boot/include/configs/mxrt117x-evk.h - configuration options;
  • u-boot/board/freescale/mxrt117x-evk/mxrt117x-evk.c - board-specific initialization code.

Run the following step-wise procedure in order to build U-Boot for the NXP i.MX RT1170 EVK board:

  • On the Linux development host, activate the cross-build environment as described in Installing and activating cross development environment:
  • $ . ACTIVATE.sh

  • Change to the U-Boot top directory:
  • $ cd u-boot

  • Configure U-Boot for the NXP i.MX RT1170 EVK board:
  • $ make distclean
    $ make mxrt117x-evk_defconfig

  • Build the U-Boot binary:
  • $ make -s

The resultant image will be u-boot.flexspi in the U-Boot top directory (i.e. the same directory where you have run the make command from).

The U-Boot command line interface provides a special command that can be used to self-upgrade the U-Boot image on the running target. Before you can run this command, you need to load an upgrade U-Boot binary to the target. Typically, you download images from a TFTP host (refer to Loading Linux images via Ethernet and TFTP), however in absence of an Ethernet link in your specific target configuration, you can also load images over serial UART or use an SD card to transfer an image file.)

The following session is an illustration of the U-Boot self-upgrade procedure using TFTP:

  • Run the U-Boot self-upgrade command sf_uboot_update to download the upgrade U-Boot image to RAM, and then install the loaded upgrade image to the QSPI Flash:
  • U-Boot 2017.09-rc1-imxrt-2.5.3 (Mar 31 2021 - 21:21:46 +0300) CPU: i.MX RT117x at 996MHz Model: NXP i.MXRT1174 EVK DRAM: 64 MiB MMC: FSL_SDHC: 0 SF: Detected is25wp128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB In: serial@4007c000 Out: serial@4007c000 Err: serial@4007c000 Net: eth0: ethernet@40424000 Hit any key to stop autoboot: 0 => sf probe 0 SF: Detected is25wp128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB => run sf_uboot_update Using ethernet@40424000 device TFTP from server 192.168.1.69; our IP address is 192.168.1.11 Filename 'rt1170/u-boot.flexspi'. Load address: 0x80007fc0 Loading: ################## 1.2 MiB/s done Bytes transferred = 258048 (3f000 hex) SF: 327680 bytes @ 0x0 Erased: OK device 0 offset 0x0, size 0x3f000 SF: 258048 bytes @ 0x0 Written: OK => reset resetting ... U-Boot 2017.09-rc1-00094-g259abd9e1e-dirty (Mar 29 2021 - 18:04:19 +0300) CPU: i.MX RT117x at 996MHz Model: NXP i.MXRT1174 EVK DRAM: 64 MiB MMC: FSL_SDHC: 0 SF: Detected is25wp128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB In: serial@4007c000 Out: serial@4007c000 Err: serial@4007c000 Net: eth0: ethernet@40424000 Hit any key to stop autoboot: 0 =>

Note that the self-upgrade sequence is a dangerous operation. You must be sure that you load and install a functional U-Boot image, which is always a tricky thing when you develop customisations to U-Boot. If something goes wrong, you can re-install the release U-Boot image as documented in Installing U-Boot to the NXP i.MX RT1170 EVK Board. The latest U-Boot image is always available from NXP i.MX RT1170 EVK board Software Materials.