Nordic IoT Axon NPU Regression Model Demo (NRF54LM20) Dev Kit Part 3 (Zephyr Linux Setup)

This is part 3 of the new award winning development IoT kit from Nordic NRF54LM20-DK Nordic Semiconductor ASA | Development Boards, Kits, Programmers | DigiKey

In this article, as previously promised, DigiKey will demonstrate how to configure this award winning development Artificial Intelligence (AI) IoT development kit in a Linux host. This demo will use the Axon Artificial Intelligence (AI) Neural Processing Unit (NPU) from Nordic NRF54LM20-DK Nordic Semiconductor ASA | Development Boards, Kits, Programmers | DigiKey, shown in this block diagram,

Please refer two the previous articles Part 1 and Part 2 as a reference if needed. Also please refer to the original setup here if required too. In order to create the proper configuration in the Linux host please do the following in the python virtual environment,

(venv) ~/DigiKey_Coffee_Cup/Nordic/$ nrfutil sdk-manager install v3.3.0-preview2

then proceed to do the next step to install the Edge Artificial Intelligence (AI) system for the Zephyr OS

~(venv) /DigiKey_Coffee_Cup/Nordic$ west init -m "https://github.com/nrfconnect/sdk-edge-ai" --mr v2.0.0
 

at this point we are ready to perform the assigned update,

(venv) ~/DigiKey_Coffee_Cup/Nordic/zephyrproject/zephyr$ west update

Now we are set to enter the world of Artificial Intelligence (AI) IoT development.

This demo will implement a regression model that executes on the Axon NPU and that supports both synchronous and asynchronous inference modes. Please remember this word for those who want to learn more about Artificial Intelligence (AI) and the keyword is…

INFERENCE

if you want to enter the world of Artificial Intelligence (AI), please remember this word and what it really means and so forth like a mantra and find its meaning. This Nordic award winning platform enables via the Nordic Edge AI in the right side of the next picture that the INFERENCE occurs in the Internet of Things (IoT) domain.

This picture shows the evolution of the migration process of the INFERENCE process from the Cloud network realm into the IoT devices from left to right. Without getting into more esoteric terms, let’s dive in. Please proceed to build the first Axon Neural Processing Unit (NPU) application demo by opening the shell,

(venv)~/DigiKey_Coffee_Cup/Nordic/$ nrfutil sdk-manager toolchain launch --ncs-version v3.3.0-preview2 --shell
Initializing shell environment!
...
...

now build the application in the shell as shown below,


(v3.3.0-preview2) ~/DigiKey_Coffee_Cup/Nordic/$ west build -p always -b nrf54lm20dk/nrf54lm20b/cpuapp edge-ai/samples/axon/hello_axon/
...
...
...

278/278] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       64772 B      1940 KB      3.26%
             RAM:        8304 B       511 KB      1.59%
        IDT_LIST:          0 GB        32 KB      0.00%
...

Connect the USB cable to the development kit as follows,

Please open a new terminal to observe the output from the Axon Neural Processing Unit (NPU). Then flash the new award winning development IoT kit from Nordic NRF54LM20-DK Nordic Semiconductor ASA | Development Boards, Kits, Programmers | DigiKey as shown here,

(venv) ~/DigiKey_Coffee_Cup/Nordic/zephyrproject/zephyr$ west flash

...
...
etc

-- west flash: rebuilding
[0/3] Performing build step for 'hello_axon'
ninja: no work to do.
[3/3] Completed 'hello_axon'
-- west flash: using runner nrfutil
-- runners.nrfutil: reset after flashing requested
Using board 001051861371
-- runners.nrfutil: Flashing file: /Digikey_Coffee_Cup/nordic/build/hello_axon/zephyr/zephyr.hex
-- runners.nrfutil: Connecting to probe
-- runners.nrfutil: Programming image
-- runners.nrfutil: Verifying image
-- runners.nrfutil: Reset
-- runners.nrfutil: Board(s) with serial number(s) 1051861371 flashed successfully.

if the system was programed successfully then we should see the following at the minicom terminal,

This demo demonstrates how to run neural model INFERENCE on the Axon NPU using the Axon NPU driver directly. This regression model uses the Zephyr’s TensorFlow Lite for Microcontrollers: Hello World_ sample. The model’s task is to replicate the sine function in the range from 0 to 2π.

The Neural System prediction results is compared to the ideal value for different iterations. The TensorFlow Lite file describing this model is processed by the Axon NPU Compiler and it changes into a format required by the Axon NPU. The compilation process output is saved in a file specifically :src/generated/nrf_axon_model_hello_axon_.h with the weights and bias values as shown in the next partial snapshot of the file,

/*********************************************************************************
 * Auto-generated nrf Axon compiled neural network model header file.
 * Model Name: hello_axon
 * Axon Neural Network Compiler Version: 0.1.0
 *********************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif

#define NRF_AXON_MODEL_HELLO_AXON_MAX_IL_BUFFER_USED 16
#define NRF_AXON_MODEL_HELLO_AXON_MAX_PSUM_BUFFER_USED 0

#if AXON_COMPILE_TIME_BUFFER_CHECK
static_assert(NRF_AXON_MODEL_HELLO_AXON_MAX_IL_BUFFER_USED < sizeof(nrf_axon_interlayer_buffer), "nrf_axon_interlayer_buffer TOO SMALL!!!!\n");

#endif
// size of axon_model_const_hello_axon: 420
const static struct {
	int8_t l00_weights[16];
	int32_t l00_biasp[16];
	int8_t l01_weights[256];
	int32_t l01_biasp[16];
	int8_t l02_weights[16];
	int32_t l02_biasp[1];

} axon_model_const_hello_axon = {
	.l00_weights = {117,28,17,-31,12,-127,-91,66,-2,-43,-44,-78,97,120,25,-33,},
	.l00_biasp = {14982,6519,-301,-3968,4727,-16256,-11648,10195,-256,-5504,2930,-9984,14255,12647,-844,-4224,},
	.l01_weights = {-18,-4,0,-20,5,23,-17,-20,-26,-8,3,1,0,-6,-8,-11,-36,-21,39,20,-15,-34,-30,-37,-16,-34,49,6,2,-26,-18,-7,0,22,7,-32,-2,-1,-23,6,-25,-17,-127,27,24,-22,-55,1,15,0,-38,-9,14,-20,19,31,4,19,-76,-26,-3,6,-71,-32,13,-20,-16,-34,-21,-9,5,38,26,-28,111,26,-22,30,53,-33,26,-13,-15,25,15,3,27,-31,-34,19,-10,25,-1,-10,27,24,-16,28,-38,27,27,32,-27,26,-11,-1,-106,11,0,1,-51,-34,13,-10,22,-29,-19,-4,14,-23,-6,-21,92,-4,29,2,91,-30,-31,-11,21,-20,-12,0,19,5,-20,12,29,20,14,-25,11,-12,25,0,-41,5,39,2,21,-22,-22,2,-101,0,12,-6,-24,-22,-3,0,20,-3,11,2,-17,-18,6,-18,1,13,6,-26,-9,17,-9,9,-8,-15,33,-1,14,-13,-20,18,38,29,-14,-23,40,24,-32,-5,-13,-12,5,29,29,-5,-3,30,-4,17,-24,7,9,3,18,-14,54,-5,-36,28,-7,-17,-13,-25,111,12,29,0,69,-3,14,-16,11,25,26,-6,-32,25,31,19,54,28,18,-21,59,12,-76,-53,-26,19,-6,-21,-15,6,28,-6,24,-27,-21,-53,12,-12,},
	.l01_biasp = {-13568,-19019,-25096,-19795,13297,9856,-14183,12926,1295,-14380,-2745,14262,3968,23596,29899,-27702,},
	.l02_weights = {33,-91,-117,-54,94,29,-50,66,-99,-50,31,-80,-33,84,47,-127,},
	.l02_biasp = {-44788,},
};


etc.....

The C source code for this regression demo is located here,

edge-ai/samples/axon/hello_axon/src/main.c

This has completed the demonstration for this new Axon Neural Processing Unit (NPU) using the Axon NPU driver directly, in this innovative Nordic IoT platform. Please stay tuned for our next part in this series. This new Embedded World 2026 award winning Nordic IoT NRF54LM20-DK development kit is available at DigiKey.

Have a great day!

This article is available in spanish here.

Este artículo está disponible en español aquí.

1 Like