Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 5 Next »

1. Hardware Setup

Prepare hardware as described below:

  1. Set the jumper J38 to position 1-2 and connect DC 5 V external power supply to J43 power jack.

  2. Connect the microUSB cable to the J11 connector on the MIMXRT1170-EVK board and the development host to provide the serial console access, which is required to run Linux (uClinux) on the i.MX RT1170. The serial console operates in U-Boot and uCLinux with the following parameters:

    • Baud rate - 115200

    • Data bits - 8

    • Stop bits - 1

    • Parity - none

  3. Connect the microUSB cable to the J20 connector on the MIMXRT1170-EVK board and the development host for SDP, which is required to install the demo image to the target board.

  4. Connect Ethernet cable to the J1 connector on the MIMXRT1170-EVK board.

  5. Connect LCD Panel RK055HDMIPI4MA0 to the board.

2. Software Setup

  1. On the development host download and install the MCUXpresso Secure Provisioning Tool provided by NXP:

  2. Download the demo image from the Emcraft web site:

    imxrt1170_demo.img - is the boot image ready to be installed to the QSPI Flash memory on the IMXRT1170-EVK board, it contains U-Boot and Linux images.

3. Installing Linux to NXP i.MX RT1170 EVK Board

  1. Set up the Boot switch on the IMXRT1170-EVK board for SDP: set SW1 as 0001 and re-enable the power supply.

  2. On the development host run the Secure Provisioning Tool. In the New Workspace window, select the MIMXRT1176 processor and click Create:

    image-20250319-100327.png
  3. Run the Flash Programmer tool: click Tools->Flash Programmer menu or press Ctrl+R. Answer yes in the pooped up window:

    image-20250319-100418.png
  4. Click the Load button, select the imxrt1170_demo.img from the file system and confirm Load:

    image-20250319-100457.png
  5. Make sure the Auto erase and Auto verify check-buttons are set and the click the Write button:

    image-20250319-100536.png
  6. Wait until the write operation is completed:

    image-20250319-100549.png
  7. When the writing is completed, close the MCUXpresso Secure Provisioning Tool. Then set up boot jumpers on the target board to boot from QSPI Flash: set SW1 as 0010, SW2 as 0000000000.

  8. Use your preferable serial communication tool to connect to the target serial console (we use picocom in this demo):

    $ picocom -l -b 115200 /dev/ttyACM0 
    picocom v3.1
    
    port is        : /dev/ttyACM0
    flowcontrol    : none
    baudrate is    : 115200
    parity is      : none
    databits are   : 8
    stopbits are   : 1
    escape is      : C-a
    local echo is  : no
    noinit is      : no
    noreset is     : no
    hangup is      : no
    nolock is      : yes
    send_cmd is    : sz -vv
    receive_cmd is : rz -vv -E
    imap is        : 
    omap is        : 
    emap is        : crcrlf,delbs,
    logfile is     : none
    initstring     : none
    exit_after is  : not set
    exit is        : no
    
    Type [C-a] [C-h] to see available commands
    Terminal ready
  9. Power cycle the board. U-Boot and then Linux should start automatically on the serial console:

    U-Boot SPL 2023.04 (Mar 14 2025 - 15:54:32 +0000)
    Trying to boot from NOR
    
    
    U-Boot 2023.04 (Mar 14 2025 - 15:54:32 +0000)
    
    Model: NXP imxrt1170-evk board
    DRAM:  960 KiB (effective 64.9 MiB)
    Core:  72 devices, 15 uclasses, devicetree: separate
    MMC:   FSL_SDHC: 0
    Loading Environment from nowhere... OK
    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-6.1.22
       Image Type:   ARM Linux Multi-File Image (uncompressed)
       Data Size:    8315694 Bytes = 7.9 MiB
       Load Address: 80008000
       Entry Point:  80008001
       Contents:
          Image 0: 8301696 Bytes = 7.9 MiB
          Image 1: 13986 Bytes = 13.7 KiB
       Verifying Checksum ... OK
    ## Flattened Device Tree from multi component Image at 30080000
       Booting using the fdt at 0x3086accc
    Working FDT set to 3086accc
       Loading Multi-File Image
       Loading Device Tree to 20329000, end 2032f6a1 ... OK
    Working FDT set to 20329000
    
    Starting kernel ...
    
    Booting Linux on physical CPU 0x0
    Linux version 6.1.22 (vskvortsov@workbench.emcraft.com) (arm-none-eabi-gcc (GNU Arm Embedded Toolchain 10.3-2021.10) 10.3.1 20210824 (release), GNU ld (GNU Arm Embedded Toolchain 10.3-2021.10) 2.36.1.20210621) #2 PREEMPT Fri Mar 14 15:29:47 UTC 2025
    CPU: ARMv7-M [411fc272] revision 2 (ARMv7M), cr=00000000
    CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    OF: fdt: Machine model: NXP IMXRT1170 EVK board
    earlycon: lpuart32_imxrt0 at MMIO32 0x4007c000 (options '')
    printk: bootconsole [lpuart32_imxrt0] enabled
    Reserved memory: created DMA memory pool at 0x83b00000, size 1 MiB
    OF: reserved mem: initialized node dmapool@83b00000, compatible id shared-dma-pool
    Zone ranges:
      Normal   [mem 0x0000000080000000-0x0000000083ffffff]
    Movable zone start for each node
    Early memory node ranges
      node   0: [mem 0x0000000080000000-0x0000000083afffff]
      node   0: [mem 0x0000000083b00000-0x0000000083ffffff]
    Initmem setup node 0 [mem 0x0000000080000000-0x0000000083ffffff]
    Built 1 zonelists, mobility grouping on.  Total pages: 16256
    Kernel command line: earlycon=lpuart32_imxrt,0x4007c000
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
    mem auto-init: stack:off, heap alloc:off, heap free:off
    Memory: 51572K/65536K available (3663K kernel code, 195K rwdata, 960K rodata, 3072K init, 93K bss, 13964K reserved, 0K cma-reserved)
    rcu: Preemptible hierarchical RCU implementation.
    rcu: RCU calculated value of scheduler-enlistment delay is 100 jiffies.
    NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
    rcu: srcu_init: Setting srcu_struct sizes based on contention.
    Switching to timer-based delay loop, resolution 41ns
    sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
    clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
    Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=24000)
    pid_max: default: 4096 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    rcu: Hierarchical SRCU implementation.
    rcu:    Max phase no-delay instances is 400.
    devtmpfs: initialized
    DMA: default coherent area is set
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
    futex hash table entries: 16 (order: -5, 192 bytes, linear)
    pinctrl core: initialized pinctrl subsystem
    NET: Registered PF_NETLINK/PF_ROUTE protocol family
    imxrt1170-pinctrl 400e8000.iomuxc: initialized IMX pinctrl driver
    imxrt1170-pinctrl 40c08000.iomuxc_lpsr: initialized IMX pinctrl driver
    imxrt1170-pinctrl 40c94000.iomuxc_snvs: initialized IMX pinctrl driver
    mxs_phy 40434000.usbphy1: supply phy-3p0 not found, using dummy regulator
    mxs_phy 40438000.usbphy2: supply phy-3p0 not found, using dummy regulator
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    imx-lpi2c 40c34000.lpci2c: use pio mode
    i2c i2c-0: LPI2C adapter registered
    pps_core: LinuxPPS API ver. 1 registered
    pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    PTP clock support registered
    Bluetooth: Core ver 2.22
    NET: Registered PF_BLUETOOTH protocol family
    Bluetooth: HCI device and connection manager initialized
    Bluetooth: HCI socket layer initialized
    Bluetooth: L2CAP socket layer initialized
    Bluetooth: SCO socket layer initialized
    clocksource: Switched to clocksource mxc_timer1
    NET: Registered PF_INET protocol family
    IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
    tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
    Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
    TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
    TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
    TCP: Hash tables configured (established 1024 bind 1024)
    UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
    UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
    NET: Registered PF_UNIX/PF_LOCAL protocol family
    RPC: Registered named UNIX socket transport module.
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    Bus freq driver module loaded
    Initialise system trusted keyrings
    workingset: timestamp_bits=30 max_order=14 bucket_order=0
    fuse: init (API version 7.37)
    Key type asymmetric registered
    Asymmetric key parser 'x509' registered
    Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
    io scheduler mq-deadline registered
    io scheduler kyber registered
    OF: graph: no port node found in /soc/mipi_dsi@4080c000
    mipi_dsi_northwest 4080c000.mipi_dsi: i.MX MIPI DSI driver probed
    mxsfb 40804000.lcdif: Defer fb probe due to dispdrv not ready
    4007c000.serial: ttyLP0 at MMIO 0x4007c010 (irq = 467, base_baud = 1500000) is a FSL_LPUART
    fsl-lpuart 4007c000.serial: Serial: Console lpuart rounded baud ratefrom 187500 to 115200
    printk: console [ttyLP0] enabled
    printk: console [ttyLP0] enabled
    printk: bootconsole [lpuart32_imxrt0] disabled
    printk: bootconsole [lpuart32_imxrt0] disabled
    PPP generic driver version 2.4.2
    PPP BSD Compression module registered
    PPP Deflate Compression module registered
    usbcore: registered new interface driver rt2800usb
    usbcore: registered new interface driver cdc_acm
    cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    usbcore: registered new interface driver uas
    usbcore: registered new interface driver usb-storage
    Goodix-TS 0-0014: supply AVDD28 not found, using dummy regulator
    Goodix-TS 0-0014: ID 911, version: 1060
    input: Goodix Capacitive TouchScreen as /devices/platform/soc/40c34000.lpci2c/i2c-0/0-0014/input/input0
    i2c_dev: i2c /dev entries driver
    usbcore: registered new interface driver btusb
    sdhci: Secure Digital Host Controller Interface driver
    sdhci: Copyright(c) Pierre Ossman
    sdhci-pltfm: SDHCI platform and OF driver helper
    mmc0 bounce up to 128 segments into one, max segment size 65536 bytes
    usbcore: registered new interface driver usbhid
    usbhid: USB HID core driver
    NET: Registered PF_PACKET protocol family
    Bluetooth: RFCOMM TTY layer initialized
    Bluetooth: RFCOMM socket layer initialized
    Bluetooth: RFCOMM ver 1.11
    ARMv7-M VFP coprocessor found
    VFP: Double precision floating points are supported
    Loading compiled-in X.509 certificates
    mmc0: SDHCI controller on 40418000.usdhc [40418000.usdhc] using DMA
    mipi_dsi_northwest 4080c000.mipi_dsi: MIPI DSI dispdv inited
    mxsfb 40804000.lcdif: registered mxc display driver mipi_dsi_northwest
    mmc0: host does not support reading read-only switch, assuming write-enable
    mmc0: new high speed SDHC card at address 0001
    mmcblk0: mmc0:0001 EB1QT 29.8 GiB 
     mmcblk0: p1
    mxsfb 40804000.lcdif: initialized
    input: gpio-keys as /devices/platform/gpio-keys/input/input2
    cfg80211: Loading compiled-in X.509 certificates for regulatory database
    cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
    platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
    cfg80211: failed to load regulatory.db
    Freeing unused kernel image (initmem) memory: 3072K
    This architecture does not have kernel memory protection.
    Run /init as init process
    [79] Jan 01 00:00:01 Running in background
    / # random: crng init done

4. Ethernet Driver Support

  1. In the target serial console configure the eth0 interface manually (using the ifconfig and route plagins of busybox), or start the DHCP client to apply the networking settings from a DHCP server:

    / # udhcpc 
    Micrel KSZ8081 or KSZ8091 40424000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=40424000.ethernet-1:00, irq=POLL)
    fec 40424000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
    / # ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr AA:BB:CC:DD:EE:F0  
              inet addr:192.168.1.74  Bcast:192.168.1.255  Mask:255.255.255.0
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4 errors:0 dropped:0 overruns:0 frame:0
              TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:796 (796.0 B)  TX bytes:684 (684.0 B)
    
    / # 
  2. From the development host validate that the target board is visible using ping:

    $ ping -c5 192.168.1.74
    PING 192.168.1.74 (192.168.1.74) 56(84) bytes of data.
    64 bytes from 192.168.1.74: icmp_seq=1 ttl=64 time=0.632 ms
    64 bytes from 192.168.1.74: icmp_seq=2 ttl=64 time=0.305 ms
    64 bytes from 192.168.1.74: icmp_seq=3 ttl=64 time=0.297 ms
    64 bytes from 192.168.1.74: icmp_seq=4 ttl=64 time=0.288 ms
    64 bytes from 192.168.1.74: icmp_seq=5 ttl=64 time=0.298 ms
    
    --- 192.168.1.74 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4112ms
    rtt min/avg/max/mdev = 0.288/0.364/0.632/0.134 ms
    $ 
  3. From the target board, validate that it is connected to the internet using ping:

    / # ping -c5 example.org
    PING example.org (93.184.215.14): 56 data bytes
    64 bytes from 93.184.215.14: seq=0 ttl=57 time=122.202 ms
    64 bytes from 93.184.215.14: seq=1 ttl=57 time=122.158 ms
    64 bytes from 93.184.215.14: seq=2 ttl=57 time=121.991 ms
    64 bytes from 93.184.215.14: seq=3 ttl=57 time=122.116 ms
    64 bytes from 93.184.215.14: seq=4 ttl=57 time=122.105 ms
    
    --- example.org ping statistics ---
    5 packets transmitted, 5 packets received, 0% packet loss
    round-trip min/avg/max = 121.991/122.114/122.202 ms
    / # 

5. TCP/IP Stack Support

With uClinux running on the i.MX RT1170, you get the full Linux TCP/IP stack TCP/IP stack (kernel version 6.1.22). 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 i.MX RT1170 is visible using ping:

    $ ping -c5 192.168.1.74
    PING 192.168.1.74 (192.168.1.74) 56(84) bytes of data.
    64 bytes from 192.168.1.74: icmp_seq=1 ttl=64 time=0.320 ms
    64 bytes from 192.168.1.74: icmp_seq=2 ttl=64 time=0.274 ms
    64 bytes from 192.168.1.74: icmp_seq=3 ttl=64 time=0.269 ms
    64 bytes from 192.168.1.74: icmp_seq=4 ttl=64 time=0.278 ms
    64 bytes from 192.168.1.74: icmp_seq=5 ttl=64 time=0.277 ms
    
    --- 192.168.1.74 ping statistics ---
    5 packets transmitted, 5 received, 0% packet loss, time 4109ms
    rtt min/avg/max/mdev = 0.269/0.283/0.320/0.018 ms
    
  2. ping the development host from the i.MX RT1170:

    / # ping -c5 192.168.1.64
    PING 192.168.1.64 (192.168.1.64): 56 data bytes
    64 bytes from 192.168.1.64: seq=0 ttl=64 time=0.510 ms
    64 bytes from 192.168.1.64: seq=1 ttl=64 time=0.407 ms
    64 bytes from 192.168.1.64: seq=2 ttl=64 time=0.394 ms
    64 bytes from 192.168.1.64: seq=3 ttl=64 time=0.402 ms
    64 bytes from 192.168.1.64: seq=4 ttl=64 time=0.404 ms
    
    --- 192.168.1.64 ping statistics ---
    5 packets transmitted, 5 packets received, 0% packet loss
    round-trip min/avg/max = 0.394/0.423/0.510 ms
    / # 
  3. On the target, start the telnetd daemon to allow connections to the i.MX RT1170:

    / # telnetd 
    / # ps | grep telnet
       90 root       864 S    telnetd
       92 root       864 S    grep telnet
    / # 
  4. Connect to the target from the development host using telnet. The target is configured to accept the 123 password for root:

    $ telnet 192.168.1.74
    Trying 192.168.1.74...
    Connected to 192.168.1.74.
    Escape character is '^]'.
    
    (none) login: root
    Password: 
    / # 
    / # ls
    bin       hello.ko  lib       proc      sys       var
    dev       httpd     linuxrc   root      tmp
    etc       init      mnt       sbin      usr
    
    / # exit
    Connection closed by foreign host.
    $ 
    
  5. The dropbear SSH daemon starts automatically on the target. Verify that dropbear allows secure connections to the target:

    / # ps | grep dropbear
       70 root       416 S    dropbear -R
       98 root       388 S    grep dropbear
  6. Connect to the target from the development host using ssh. The first connection takes several seconds to establish as the i.MX RT1170 runs computation-extensive key calculations. Again, enter 123 on the password prompt:

    $ ssh root@192.168.1.74
    The authenticity of host '192.168.1.74 (192.168.1.74)' can't be established.
    ED25519 key fingerprint is SHA256:/5yRBM3MvDHN7Lu4Sd1zDNpKp3c/G34RSH0qdQubRTI.
    This key is not known by any other names
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '192.168.1.74' (ED25519) to the list of known hosts.
    root@192.168.1.74's password: 
    / # ls
    bin       hello.ko  lib       proc      sys       var
    dev       httpd     linuxrc   root      tmp
    etc       init      mnt       sbin      usr
    
    / # exit
    Connection to 192.168.1.74 closed.
    $
  7. Use ntpd to synchronize the time on the target with the time provided by a public server:

    / # date
    Thu Jan  1 00:11:00 UTC 1970
    / # ntpd -p 0.fedora.pool.ntp.org
    / # sleep 5
    / # date
    Fri Sep  1 10:07:58 UTC 2023
    / #
  8. Use wget to download a file from a remote server:

    / # wget ftp://ftp.gnu.org/README
    Connecting to ftp.gnu.org (209.51.188.20:21)
    saving to 'README'
    README               100% |********************************|  
    2748  0:00:00 ETA
    'README' saved
    / # 
    / # cat README
    This is ftp.gnu.org, the FTP server of the the GNU project.
    ...
  9. Start the HTTP daemon:

    / # httpd -h /httpd/html/
    / #
  10. From a local host, open a Web browser to the i.MX RT1170 and watch the demo web page provided by the target. The i.MX RT1170 shows the current time and date as well as the list of the currently running processes:

    image-20250319-100704.png
  11. Mount a directory exported by a development host over NFS:

    / # mount -o nolock,rsize=1024 192.168.1.99:/srv/nfs /mnt/nfs
    / # ls /mnt/nfs/
    SimpleClass  linux-dp     test
    / # cp /bin/busybox /mnt/nfs
    / # cp /mnt/nfs/busybox /tmp
    / # md5sum /bin/busybox /tmp/busybox
    bb39cf3470150200a35c41bd6f78ef92  /bin/busybox
    bb39cf3470150200a35c41bd6f78ef92  /tmp/busybox

6. Support USB Host Stack Interface

  1. Attach a USB Flash device to the USB1 or USB2 connector. Verify that it is automatically detected and can be mounted:

    ci_hdrc ci_hdrc.0: EHCI Host Controller
    ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
    ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    usb 1-1: new high-speed USB device number 2 using ci_hdrc
    usb-storage 1-1:1.0: USB Mass Storage device detected
    scsi host0: usb-storage 1-1:1.0
    scsi 0:0:0:0: Direct-Access     Generic  Flash Disk     8.07 PQ: 0 ANSI: 2
    sd 0:0:0:0: [sda] 8228864 512-byte logical blocks: (4.21 GB/3.92 GiB)
    sd 0:0:0:0: [sda] Write Protect is off
    sd 0:0:0:0: [sda] No Caching mode page found
    sd 0:0:0:0: [sda] Assuming drive cache: write through
     sda: sda1
    sd 0:0:0:0: [sda] Attached SCSI removable disk
    / # mount /dev/sda1 /mnt/usbflash/
    / # ls -la /mnt/usbflash/
    drwxr-xr-x    3 root     root          4096 Jan  1 00:00 .
    drwxrwxrwx    8 root     root             0 Jun 22  2023 ..
    drwxr-xr-x    2 root     root          4096 May 25  2023 
    System Volume Information
    -rwxr-xr-x    1 root     root           319 Jan  1  1980 data.log
    / #
  2. Unmount the USB Flash device:

    / # umount /mnt/usbflash/
    / #

7. Support Loading / Unloading Kernel Modules

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

    / # insmod hello.ko
    Hello, world
    / #
  2. Show the status of the loaded kernel modules:

    / # lsmod
    Module                  Size  Used by    Not tainted
    hello                    576  0
    / #
  3. Unload the module from the Linux kernel:

    / # rmmod hello
    Goodbye, world
    / #

8. Running GUI Demo

Step through the following procedure to run the GUI demo, LVGL widgets example:

  1. From the Linux shell, type the widgets_gui_demo command to run the widgets demo:

    / # widgets_gui_demo
  2. Make sure the demo appears on the LCD:

    image-20250319-100737.png
  3. Use touch panel to validate various GUI controls provided by the demo:

    image-20250319-100759.png
  • No labels