Running Zephyr on NXP i.MX RT

This application note has been explicitly tested on the NXP MIMXRT1060-EVKB board, however, it should apply to the other NXP EVK boards in the i.MX RT family as well, perhaps, with some minor changes to the software.

1. Connecting MIMXRT1060-EVKB Board to the NAVQ+ Kit

The following hardware setup is required for installing and running a Zephyr sample on the NXP MIMXRT1060-EVKB board:

  1. Remove jumpers J9 and J10, to disconnect the SWD signals from onboard debug circuit.  These jumpers are installed by default.

  2. Use default power selection on J40 with pins 5-6 shorted (power supply via J1).

  3. Connect the external J-Link probe to J2, 20-pin dual-row 0.1" header.

  4. Connect the Ethernet cable to the RJ45 connector (J43) and to the local network.

  5. Connect a USB hub to the NAVQ+ kit.

  6. Connect a USB cable from the USB hub to J1. The USB connector J1 is used to power the board, and provides a UART/USB bridge through the onboard debug circuit (serial console). It is important to power up the board before powering up J-Link.

  7. Connect a USB cable from the USB hub to the J-Link probe. It is important to do so after the board has been powered up, otherwise, the J-Link probe won't be able to detect the MCU.

2. Connecting MIMXRT1060-EVKB Board to a Linux PC

The MIMXRT1060-EVKB Board can be connected to any Linux PC the same way as it is connected to the NAVQ+ kit. Note that the USB hub is not necessary if the Linux PC has more than one USB port.

3. Building Zephyr for MIMXRT1060-EVKB Board

Zephyr samples can be built as described in the Zephyr Project documentation:

https://docs.zephyrproject.org/latest/develop/getting_started/index.html

For example, use the following command to build the hello_world sample for the MIMXRT1060-EVKB board:

cd zephyr west build -p always -b mimxrt1060_evkb samples/hello_world

4. Installing Zephyr on MIMXRT1060-EVKB Board from the NAVQ+ Kit

Use west to install Zephyr from the NAVQ+ Kit:

user@imx8mpnavq:~/work/zephyrproject/zephyr$ west flash -- west flash: rebuilding ninja: no work to do. -- west flash: using runner jlink -- runners.jlink: JLink version: 7.92g -- runners.jlink: Flashing file: /mnt/sdcard/work/zephyrproject/zephyr/build/zephyr/zephyr.bin

5. Installing Zephyr on MIMXRT1060-EVKB Board from a Linux PC

If the J-Link probe is directly connected to the build machine then the “west flash" command can be used to flash the sample as described in the Zephyr Project documentation:

https://docs.zephyrproject.org/latest/develop/getting_started/index.html

However, it is not always convenient to use the same PC for building and flashing. It is actually enough to install the J-Link software

https://www.segger.com/downloads/jlink/

on the host PC to be able to Flash the boards over the J-Link probe. After installing the J-Link software, verify that the J-Link probe is detected by the SEGGER J-Link Commander and identifies the MCU successfully:

$ JLinkExe -nogui 1 -if swd -speed auto -device MIMXRT1062xxx6A SEGGER J-Link Commander V7.92c (Compiled Aug 30 2023 14:58:04) DLL version V7.92c, compiled Aug 30 2023 14:57:42 Connecting to J-Link via USB...O.K. ... J-Link>connect ... Cortex-M7 identified. J-Link>

Create the J-Link Commander script for flashing Zephyr onto the MIMXRT1060-EVKB board:

Put the build/zephyr/zephyr.bin file into the current directory and run the following command:

As soon as a Zephyr image is flashed, it can be started by resetting the board using the reset button or the “reset/go" command sequence of the J-Link Commander:

Now you can connect to the target serial console using a terminal program on your Linux PC, for example:

Depending on the installed Zephyr application, you will see some output on the serial console after reset. The Zephyr banner is usually printed:

6. Controlling MIMXRT1060-EVKB Board LEDs from the NAVQ+ Kit

Emcraft provides the simple Zephyr demo (emcraft/app/led_network_control) that allows to control the board LEDs from the NAVQ+ kit over the local network.

  1. Before building the demo, choose a static IP address for your target board and configure the demo appropriately, for example:

  1. Build the led_network_control sample for the MIMXRT1060-EVKB board:

  1. Install the demo on the target board as described above. If you connect to the target serial console, you will see the following output after reset:

  1. From the NAVQ+ console, connect to the target board using telnet:

  1. Type “list" to see the available LEDs on the target board:

  1. Turn led-1 on and off: