Running Zephyr on NXP S32K344 Evaluation Board

1. Connecting S32K344 Evaluation Board to the NAVQ+ Kit

 

The following hardware setup is required for installing and running a Zephyr sample on the NXP S32K344 Evaluation Board:

  1. The serial console is provided through “lpuart2” on the 7-pin DCD-LZ debug connector “P6”. Connect it to the UART3 on the NAVQ+ J9 connector:

Pin Function

S32K344 Connector

NAVQ+ Kit Connector

UART_TX

P6.2

J9.3

UART_RX

P6.3

J9.2

GND

P6.10

J9.6

  1. The SEGGER J-Link is connected to the P26 connector (this is a 10 pin 0.50” space JTAG with the standard pinout used by standard Arm debuggers). Ensure pin 1 on the PCB silkscreen is aligned with pin 1 on the debugger (refer to the picture above). Connect the SEGGER J-Link to the USB port of the NAVQ+ kit.

  2. The Ethernet connection to the local network using the RDDRONE-T1ADAPT Ethernet media converter connected to the P9 100Base-T1 Ethernet Connector:

Pin Function

S32K344 Connector

RDDRONE-T1ADAPT Connector

TRXP

P9.1

J3.1

TRXN

P9.2

J3.2

The power is provided by the NAVQ+ kit:

Pin Function

NAVQ+ Kit Connector

RDDRONE-T1ADAPT Connector

+5V

J6.1

J2.1

GND

J6.6

J2.3

  1. The power is to be supplied at the 5 pin P27 connector at the top left corner of the board (Pin 1-2 power, Pin 3 NC, Pin 4-5 ground):

Pin Function

S32K344 Connector

NAVQ+ Kit Connector

+5V

P27.1

J6.1

+5V

P27.2

J6.2

GND

P27.4

J6.4

GND

P27.5

J6.5

2. Connecting S32K344 Evaluation Board to a Linux PC

The following hardware setup is required for installing and running a Zephyr sample on the NXP S32K344 Evaluation Board:

  1. The serial console is provided through “lpuart2” on the 7-pin DCD-LZ debug connector “P6”

Pin Function

S32K344 Connector

UART_TX

P6.2

UART_RX

P6.3

GND

P6.10

  1. The SEGGER J-Link is connected to the P26 connector (this is a 10 pin 0.50” space JTAG with the standard pinout used by standard Arm debuggers). Ensure pin 1 on the PCB silkscreen is aligned with pin 1 on the debugger (refer to the picture above).

  2. The Ethernet connection to the local network using the RDDRONE-T1ADAPT Ethernet media converter connected to the P9 100Base-T1 Ethernet Connector.

  3. The power is to be supplied at the 5 pin P27 connector at the top left corner of the board (Pin 1-2 power, Pin 3 NC, Pin 4-5 ground). The input voltage range is from 5V to 40V.

3. Building Zephyr for S32K344 Evaluation 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 S32K344 Evaluation Board:

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

4. Installing Zephyr on S32K344 Evaluation 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

As soon as a Zephyr image is flashed, it can be started by resetting the board using the reset button. Now you can connect to the target serial console using the “picocom” terminal program on the NAVQ+ kit:

$ sudo picocom -b 115200 /dev/ttymxc2 ... Type [C-a] [C-h] to see available commands Terminal ready

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

5. Installing Zephyr on S32K344 Evaluation 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:

Create the J-Link Commander script for flashing Zephyr onto the S32K344 Evaluation Board:

Put the build/zephyr/zephyr.hex 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 S32K344 Evaluation 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:

  2. Build the led_network_control sample for the S32K344 Evaluation Board:

  3. 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:

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

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

  6. Turn user_led1_green on and off: