Building and Installing Linux uImage on the NXP i.MX RT1170 EVK Board Print


This application note explains how to build and install (or update) a bootable Linux image (rootfs.uImage). A bootable Linux image can be booted to the target via TFTP (refer to Loading Linux images via Ethernet and TFTP) or installed to QSPI Flash.

Linux images are built on the cross-development host. Make sure that you activate the cross development environment as described in Installing and Activating Cross Development Environment.

In the Emcraft software distribution, Linux images are built from project directories. A project defines a concrete Linux configuration ready for installation to the target. Each project is defined by the following files:

  • <project>.kernel.${MCU} - kernel configuration for the project;
  • <project>.busybox - busybox configuration for the project;
  • <project>.initrams - spec file for the project root filesystem (initramfs).

When you run make from the project directory (for instance, from projects/rootfs), the build system builds project-specific versions of the Linux kernel and busybox, then creates an initramfs filesystem containing the newly built busybox binary as well as other target files defined by the initramfs filesystem specification file, and finally wraps it all up into a single Linux image (rootfs.uImage) ready for download to the target.

To sum it up, to build a Linux project do the following:

  1. Activate the cross development environment:
  2. $ . ACTIVATE.sh

  3. Change to the project directory, for instance:
  4. $ cd projects/rootfs

  5. Run make:
  6. $ make

The make will create the project rootfs.uImage ready for load to the target.

To install or update the Linux image, copy the rootfs.uImage image to TFTP server and run the following commands in U-Boot command monitor:

  1. Customize the ipaddr, serverip and tftpdir variables in U-Boot to enable TFTP download:
  2. => env default -a -f ## Resetting to default environment => setenv ipaddr 192.168.1.11 => setenv serverip 192.168.1.69 => setenv tftpdir rt1170/ => savee Saving Environment to SPI Flash... SF: Detected is25wp128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB Erasing SPI flash...Writing to SPI flash...done Valid environment: 2

  3. Use the sf_kernel_update command to download the Linux image to the target board and install it to the QSPI Flash:
  4. => sf probe 0 SF: Detected is25wp128a with page size 256 Bytes, erase size 64 KiB, total 16 MiB => run sf_kernel_update Using ethernet@40424000 device TFTP from server 192.168.1.69; our IP address is 192.168.1.11 Filename 'rt1170/rootfs.uImage'. Load address: 0x80007fc0 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ############################################# 1.3 MiB/s done Bytes transferred = 5423698 (52c252 hex) SF: 10485760 bytes @ 0x80000 Erased: OK device 0 offset 0x80000, size 0x52c252 SF: 5423698 bytes @ 0x80000 Written: OK =>

  5. Next board reset will result in auto booting the installed Linux image:
  6. => reset resetting ... 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 ## Booting kernel from Legacy Image at 30080000 ... Image Name: Linux-4.5.0-imxrt-2.5.3 Image Type: ARM Linux Multi-File Image (uncompressed) Data Size: 5423634 Bytes = 5.2 MiB Load Address: 80008000 Entry Point: 80008001 Contents: Image 0: 5416512 Bytes = 5.2 MiB Image 1: 7110 Bytes = 6.9 KiB Verifying Checksum ... OK ## Flattened Device Tree from multi component Image at 30080000 Booting using the fdt at 0x305aa68c Loading Multi-File Image ... OK Loading Device Tree to 83e68000, end 83e6cbc5 ... OK Starting kernel ... Booting Linux on physical CPU 0x0 Linux version 4.5.0-imxrt-2.5.3 (vskvortsov@sergmir) (gcc version 4.7.4 20130508 (prerelease) (20161027-112109- build on iron.emcraft.com by sergmir) ) #1 Wed Mar 31 21:06:46 MSK 2021 ... init started: BusyBox v1.24.2 (2021-03-31 21:05:22 MSK) / #