Axon Low Power

The Axon Low Power sample demonstrates the power efficiency of the Nordic Axon NPU by running a wakeword-class neural network in a continuous sliding-window inference loop. Between inference sweeps, the CPU and NPU enter a low-power state drawing less than 10 µA of current on average, making the Axon NPU well-suited for Edge AI workloads on battery-powered devices. Use this sample to profile Axon NPU active and idle current on hardware with a power profiler.

Requirements

The sample supports the following development kits:

Hardware platforms

PCA

Board name

Board target

nRF54LM20 DK

PCA10184

nrf54lm20dk

nrf54lm20dk/nrf54lm20b/cpuapp

Overview

The sample loads the okay_nordic wakeword model (compiled to src/generated/nrf_axon_model_okay_nordic.h by the Axon NPU Compiler) and a set of 102 reference mel-spectrogram frames stored in the src/mel_test_vector.c file. Those frames were captured from a real “okay nordic” utterance using the ww_kws application. The model carries approximately 25 KB of int8 weights across 12 layers and maintains 6 persistent recurrent-state buffers, making it representative of a real production wakeword model.

At start-up the sample:

  1. Initializes the Axon NPU platform and loads the model.

  2. Reads the model’s input quantization parameters.

  3. Builds 100 quantized input windows by sliding a 3-frame window one frame at a time over the 102 mel frames. Each window is packed in channel-first (CHW) order as required by the model: for each mel bin, the three time-step values are stored consecutively.

  4. Enters a continuous inference loop that runs all 100 windows per sweep (by calling nrf_axon_nn_model_infer_sync for each window), then sleeps for CONFIG_AXON_LOW_POWER_SLEEP_BETWEEN_SWEEPS_MS milliseconds before repeating.

Because inference runs on dedicated NPU silicon, the CPU remains free during neural network inference and can enter an idle state between inferences, resulting in a low overall system duty cycle. The default build disables all logging, console output, and serial peripherals, giving an accurate view of the NPU’s current consumption without UART overhead. The debug build variant enables logging so you can observe the inference flow on a serial terminal.

Configuration

See Configuring and building for information about how to permanently or temporarily change the configuration.

Configuration options

The following sample-specific Kconfig options are used in this sample:

CONFIG_AXON_LOW_POWER_SLEEP_BETWEEN_SWEEPS_MS

(int) Sleep duration between sliding-window sweeps (milliseconds)

Delay after each full sliding-window inference sweep before the next sweep. Use 0 for back-to-back sweeps (higher duty cycle). Increase for lower average current.

CONFIG_AXON_LOW_POWER_GPIO_TRACING

(bool) GPIO trace for inference and sweeps

Drive two scope/logic-analyzer pins (see devicetree aliases in the board overlay): infer-trace-gpios - high only during each nrf_axon_nn_model_infer_sync() call. sweep-trace-gpios - high for the full sliding-window sweep (one inference per window in that pass).

CONFIG_AXON_LOW_POWER_LED_INDICATION

(bool) LED indication during sweep (devicetree led0)

LED lit during each full sliding-window sweep (same envelope as sweep-trace-gpios when GPIO tracing is enabled). Used to confirm that sample is running as expected without logging.

Build types

The sample supports the following build types:

Axon Low Power build types

Build type

File name

Description

Default

prj.conf

Logging and console are disabled and Power Management (PM) is enabled. Use this build for power measurements.

Debug

prj_debug.conf

Logging is enabled in minimal mode. Use this build for functional verification on a serial terminal.

GPIO trace

prj_gpio_trace.conf

Same as the default build, but with CONFIG_AXON_LOW_POWER_GPIO_TRACING Kconfig option enabled. This drives two GPIO pins, which are defined in the board’s DeviceTree overlay file (see the boards/ directory). You can capture inference and sweep timing on a logic analyzer or oscilloscope (for example, the Power Profiler Kit II (PPK2)).

See Custom build types and Providing CMake options for more information.

Building and running

This sample can be found under samples/axon/axon_low_power in the Edge AI Add-on folder structure.

To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.

GPIO trace pins

When using the GPIO-trace variant, connect a logic analyzer or oscilloscope to the pins defined in the boards/nrf54lm20dk_nrf54lm20b_cpuapp.overlay file:

Pin (default)

Signal

Description

P1.04

infer-trace-gpios

High during each nrf_axon_nn_model_infer_sync call

P1.05

sweep-trace-gpios

High for the full sliding-window sweep

Testing

To observe the logging output, build the sample with the FILE_SUFFIX=debug argument.

After programming the sample to your development kit, complete the following steps to test it:

  1. Connect the kit to the computer using a USB cable. The kit is assigned a serial port. Serial ports are referred to as COM ports on Windows, /dev/ttyACM devices on Linux, and /dev/tty devices on macOS. To list Nordic Semiconductor devices connected to your computer together with their serial ports, open a terminal and run the nrfutil device list command. Alternatively, check your operating system’s device manager or its equivalent.

  2. Connect to the kit with a terminal emulator (for example, the Serial Terminal app). See Testing and optimization for the required settings and steps.

  3. Reset the development kit.

  4. Observe the logging output in the terminal.

Sample output

The following output is logged in the terminal when using the debug build variant:

I: Model: okay_nordic
I: Input size: 120
I: Output size: 1
I: 102 captured frames -> 100 sliding windows
I: Axon NPU platform and model ready
I: Quantization params: zp=-128, mult=1759218604, round=30
I: Quantized 100 input windows (CHW layout)
I: Running 100-window sweep (iteration 0)
I: Sleeping 1000 ms
I: Running 100-window sweep (iteration 1)
I: Sleeping 1000 ms
...

Dependencies

This sample uses the following Edge AI Add-on libraries:

It uses the following Zephyr libraries: