Running Linux on i.MX RT10xx in 5 Minutes

1. Hardware Setup

Prepare hardware as described below:

  1. Connect the microUSB cable to the J28 connector on the MIMXRT1050-EVKB board or to the J1 connector on the MIMXRT1060-EVKB board and the development host to provide the power and serial console access, which is required to run Linux (uClinux) on the i.MX RT10xx. The serial console operates in U-Boot and uCLinux with the following parameters:

    • Baud rate - 115200

    • Data bits - 8

    • Stop bits - 1

    • Parity - none

  2. Connect Ethernet cable to the J19 connector on the MIMXRT1050-EVKB board or to the J43 connector on the MIMXRT1060-EVKB board.

  3. The microUSB SD Card used to boot the system on the MIMXRT1050/1060-EVKB board.
    Since U-Boot (SPL+TPL) + U-Boot environment are located at the 0x400..0x100000 range of the raw SD Card address-space, the SD Card must be partitioned properly, so that U-Boot does not overwrite the file system on the partition. The SD Card must contain at least one partition started at a at least 1MB raw offset. The partition must be FATFS-formatted. Usually, a new SD Card satisfies these requirements by default so most likely no special preparations are required unless the card has been reformatted in some other way in other projects.

2. Installing Linux to NXP i.MX RT1050/1060 EVKB Board

  1. Download the bootable U-Boot and Linux images from the Emcraft web site: for i.MX RT1050 EVKB board

    for i.MX RT1060 EVKB board

    where SPL is the U-Boot SPL prebuilt image; u-boot.img is the U-Boot TPL prebuilt image; rootfs.uImage is the prebuilt rootfs project image.

  2. Plug in the MicroSD card to the cross-development host.

  3. Find out a /dev/sdX device the system has assigned to your SD Card:

    $ dmesg | tail [ 456.470775] usbcore: registered new interface driver usb-storage [ 456.482079] usbcore: registered new interface driver uas [ 457.501716] scsi 3:0:0:0: Direct-Access Generic STORAGE DEVICE 0821 PQ: 0 ANSI: 6 [ 457.508132] sd 3:0:0:0: Attached scsi generic sg2 type 0 [ 457.715113] sd 3:0:0:0: [sdb] 15446016 512-byte logical blocks: (7.91 GB/7.37 GiB) [ 457.733992] sd 3:0:0:0: [sdb] Write Protect is off [ 457.733999] sd 3:0:0:0: [sdb] Mode Sense: 23 00 00 00 [ 457.753808] sd 3:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 457.840489] sdb: sdb1 [ 457.840845] sd 3:0:0:0: [sdb] Attached SCSI removable disk
  4. Install U-Boot to the microSD card:

    $ sudo dd if=SPL of=/dev/sdX bs=1k seek=1 conv=notrunc; sync $ sudo dd if=u-boot.img of=/dev/sdX bs=1k seek=128 conv=notrunc; sync
  5. Install the rootfs project to the microSD card:

    $ sudo mount /dev/sdX /mnt $ cp rootfs.uImage /mnt
  6. Install U-Boot splash screen.

    Copy the file to the splash.bmp file on the SD card:

  7. Unplug the microSD card from the development host. Set Boot SW.7 as 1010, insert the micro SD card into the microSD slot on the target board and power the board. The system should boot up on the board:

3. 3. Ethernet Driver Support

  1. Power cycle the board. While U-Boot is coming up, press any key on the serial console to enter the U-Boot command line interface:

  2. From the U-Boot command line interface, reset to the default environment:

  3. Set the ipaddr, serverip, gatewayip and netmask U-Boot environment variables:

  4. ping the development host from the target board:

  5. Load rootfs.uImage using the U-Boot tftp command:

  6. Reset the board and let it boot up to the Linux shell:

  7. From the development host validate that the target board is visible using ping:

  8. From the target board, validate that the development host is visible using ping:

4. TCP/IP Stack Support

With uClinux running on the i.MX RT10xx, you get the full Linux TCP/IP stack (kernel version 5.15.71). Userspace POSIX APIs are provided by the uClibc library. Key user-space networking tools and utilities are available from the multi-call busybox. Additional tools and packages, such as for instance the SSH dropbear server, can be built specifically for uClinux. All in all, you have the powerful Linux TCP/IP stack at your disposal.

  1. From the development host validate that the target board is visible using ping:

  2. ping the development host from the target board:

  3. On the target, start the telnetd daemon to allow connections to the target board:

  4. Connect to the target from the development host using telnet. The target is configured to accept the 123 password for root:

  5. The dropbear SSH daemon starts automatically on the target. Verify that dropbear allows secure connections to the target:

  6. Connect to the target from the development host using ssh. The first connection takes several seconds to establish as the target runs computation-extensive key calculations. Again, enter 123 on the password prompt:

  7. On the target, enable access to the Internet by configuring a default gateway. Note also that the system makes use of the public name server provided by Google:

  8. Use ntpd to synchronize the time on the target with the time provided by a public server:

  9. Use wget to download a file from a remote server:

  10. Mount a directory exported by a development host over NFS:

  11. Start the HTTP daemon:

  12. From a local host, open a Web browser to the target and watch the demo web page provided by the target. The target shows the current time and date as well as the list of the currently running processes:

    image-20250119-083345.png

5. Support USB Host Stack Interface

  1. Attach a USB Flash device to the J9 connector for the imxrt1050-evkb board or to the J48 connector for the imxrt1060-evkb board. Verify that it is automatically detected and can be mounted:

  2. Unmount the USB Flash device:

6. Support Loading / Unloading Kernel Modules

  1. From the Linux shell, load the demo kernel module:

  2. Show the status of the loaded kernel modules:

  3. Unload the module from the Linux kernel:

7. Running Emcraft Ebike Demo

Step through the following procedure to run the Emcraft Ebike demo:

  1. LCD backlight power on:

  2. From the Linux shell, type the ebike_gui_demo command to run the ebike demo:

  3. Click to the padlock icon in the bottom right corner of the screen to switch to the Unlock Your Bike group.

    image-20250119-083447.png
  4. Click 4 any digits and then v. Make sure the correct PIN-code in printed out to the Linux shell terminal:

  5. Click to the bike icon to switch back to the Driving Information group.

  6. Press and hold the SW8 button, which resides on the opposite side of the target board to LCD. Make sure that the Speed, Trip, Odometer and other values are increasing on the corresponding widgets on the LCD. If release the SW8 button the Speed reading is decreasing.