The purpose of this article is to illustrate how to use Zephyr RTOS on the on the very inexpensive but powerful NXP-MCXN236 Development Board on a Linux host.
The NXP-MCXN236 Development Board features a 32-bit Arm Cortex-M33 microcontroller that is suitable for Industrial and Consumer Internet of Things (IoT) applications. The corresponding block diagram for this NXP-MCXN236 Development Board is shown below,
After installing Zephyr on the development host (similar to previous article), please proceed to install the corresponding LinkServer_26.6.137.x86_64.deb.bin file from the NXP website. This will allow to complete the design flow for the flashing process. To verify its installation, please proceed with,
DigiKey_Coffee_Cup: /usr/local/LinkServer/LinkServer --version
ls (uutils coreutils) 0.8.0
Also verify using probing philoshophy as follows to verify the device in question after connecting the developement kit to the host via the J10 USB port using the USB cable that is included,
DigiKey_Coffee_Cup: /zephyrproject/zephyr$ LinkServer probes
# Description Serial Device Board Capabilities
--- --------------------------------------------- ------------- -------- ------------ ----------------
1 MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146 NTHJHYIGWSDV5 MCXN236 FRDM-MCXN236 DEBUG, VCOM, SIO
If this step is completed, then proceed to modify the source code located on samples/hello_world/src/main.c
/*
* Copyright (c) 2012-2014 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
int main(void)
{
printf("DigiKey_Coffee_Cup Hello World! %s\n", CONFIG_BOARD_TARGET);
return 0;
}
and build the hello world application from python virtual environment as follows,
(venv) DigiKey_Coffee_Cup: /zephyrproject/zephyr/ west build -b frdm_mcxn236 samples/hello_world
...
...
v4.4.0-8487-g17939cff6553
[168/168] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 27504 B 1 MB 2.62%
RAM: 4328 B 192 KB 2.20%
SRAM1: 0 B 96 KB 0.00%
IDT_LIST: 0 B 32 KB 0.00%
Open a new terminal and open a minicom session. Finally, proceed to flash the hello world application to the NXP-MCXN236 Development Board.
(venv) DigiKey_Coffee_Cup: /zephyrproject/zephyr$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner linkserver
RUNNER - gdb_port = 3333, semih port = 8888
LinkServer: /usr/local/LinkServer/LinkServer, version v26.6.137
INFO: Exact match for MCXN236:FRDM-MCXN236 found
INFO: Selected device MCXN236:FRDM-MCXN236
INFO: Selected probe #1 NTHJHYIGWSDV5 (MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146)
INFO: MCU-Link firmware update `check`: Probe ([NTHJHYIGWSDV5] [MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146]) is running a firmware version which is older than the included firmware version [3.172]
INFO: Selected device matches probe's target identification info
The minicom terminal should display the following,
Welcome to minicom 2.10
OPTIONS: I18n
Port /dev/ttyACM0, 08:34:37 [U]
Press CTRL-A Z for help on special keys
*** Booting Zephyr OS build v4.4.0-8487-g17939cff6553 ***
DigiKey_Coffee_Cup Hello World! frdm_mcxn236/mcxn236
Now, build the blink LED demo,
(venv) DigiKey_Coffee_Cup: west build -b frdm_mcxn236 samples/basic/blinky
...
...
[168/168] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 27580 B 1 MB 2.63%
RAM: 4328 B 192 KB 2.20%
SRAM1: 0 B 96 KB 0.00%
IDT_LIST: 0 B 32 KB 0.00%
Then proceed to flash,
(venv) DigiKey_Coffee_Cup: west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner linkserver
RUNNER - gdb_port = 3333, semih port = 8888
LinkServer: /usr/local/LinkServer/LinkServer, version v26.6.137
INFO: Exact match for MCXN236:FRDM-MCXN236 found
INFO: Selected device MCXN236:FRDM-MCXN236
INFO: Selected probe #1 NTHJHYIGWSDV5 (MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146)
INFO: MCU-Link firmware update `check`: Probe ([NTHJHYIGWSDV5] [MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146]) is running a firmware version which is older than the included firmware version [3.172]
INFO: Selected device matches probe's target identification info
The minicom terminal should display the following,
*** Booting Zephyr OS build v4.4.0-8487-g17939cff6553 ***
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
LED state: OFF
LED state: ON
...
...
The following video shows the Zephyr blink demo of the RGB onboard LED in the NXP-MCXN236 Development Board,
Now build the syncronization demo of basic kernel thread synchonization in the Zephyr RTOS,
(venv) DigiKey_Coffee_Cup: zephyrproject/zephyr$ west build -b frdm_mcxn236 samples/synchronization
...
...
...
[168/168] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
FLASH: 28472 B 1 MB 2.72%
RAM: 6824 B 192 KB 3.47%
SRAM1: 0 B 96 KB 0.00%
IDT_LIST: 0 B 32 KB 0.00%
while keeping the minicom terminal open flash it,
/zephyrproject/zephyr$ west flash
-- west flash: rebuilding
ninja: no work to do.
-- west flash: using runner linkserver
RUNNER - gdb_port = 3333, semih port = 8888
LinkServer: /usr/local/LinkServer/LinkServer, version v26.6.137
INFO: Exact match for MCXN236:FRDM-MCXN236 found
INFO: Selected device MCXN236:FRDM-MCXN236
INFO: Selected probe #1 NTHJHYIGWSDV5 (MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146)
INFO: MCU-Link firmware update `check`: Probe ([NTHJHYIGWSDV5] [MCU-LINK FRDM-MCXN236 (r0E7) CMSIS-DAP V3.146]) is running a firmware version which is older than the included firmware version [3.172]
INFO: Selected device matches probe's target identification info
the minicom terminal should display the following Zephyr thread information from the platform,
*** Booting Zephyr OS build v4.4.0-8487-g17939cff6553 ***
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
thread_b: Hello World from cpu 0 on frdm_mcxn236!
thread_a: Hello World from cpu 0 on frdm_mcxn236!
...
...
This demonstrates that Zephyr kernel scheduling, communication, and timing are operating as expected.
The NXP-MCXN236 Development Board is a low-cost but very powerful design and evaluation board based on the MCX N236 device with a 64 Mbit external serial flash provided by Winbond. The board also features a high-speed USB circuit, one accelerometer sensor, CAN PHY, Audio codec (DNP), DMIC sensor, RGB LED, push buttons, and MCU-Link debug probe circuit. The board is compatible with the Arduino shield modules and mikroBUS headers. The board also supports headers compatible with a camera module like the following one if currently purchased it before as a spare and still have it, since it is currently obsolete,
or this one that is available at DigiKey,
compatible with an NXP low-cost LCD module like this one available at DigiKey,
The very inexpensive but powerful NXP-MCXN236 Development Board. is compact and scalable development board, for rapid prototyping of MCX N23X MCUs for many possible consumer and IoT applications and is available at DigiKey. Stay tuned for more information about these NXP platforms.
Have a nice day!
This article is available in spanish here.
Este articulo esta disponible en espanol aqui.




