Getting Started with Edge AI
End-to-end workflow for building an Edge AI firmware project on the nRF54LM20B with FirmwareMaestro and the Axon NPU.
This walkthrough takes you from a blank workspace to a flashable wake-word demo running on the nRF54LM20 DK with the Axon NPU.
Prerequisites
- An nRF54LM20 DK (PCA10184) with the B variant of the SoC if you want NPU acceleration
- nRF Connect SDK installed via the Toolchain Manager (any version with Edge AI Add-on v2.0 support)
- The Edge AI Add-on v2.0 installed into your nRF Connect SDK workspace
- Either Docker (for the Axon Compiler image) or a Nordic Edge AI Lab account
- The fwm CLI installed — see Installing the fwm CLI
1. Pick or train a model
You have three reasonable starting points:
| Path | When to use |
|---|---|
| Edge AI Lab — text-to-wake-word | You want a custom wake phrase with no ML setup |
| Edge AI Lab — model builder | Audio classification or sensor anomaly detection |
| Edge Impulse | You already collect data there or need full MLOps |
All three roads end in the same place: a quantised .tflite model.
2. Compile for the Axon NPU
Run the model through the Axon Compiler (Docker image is the fastest):
docker run --rm -v $(pwd):/work nordicsemi/axon-compiler:latest \
--input model.tflite \
--output-dir generated/You get back:
generated/model.h— the compiled model + weightsgenerated/test_vectors.h— golden input/output for a self-test- A report listing per-layer inference time, memory footprint, and quantisation loss
If a layer is not in the Axon's natively accelerated op set the report will say so and that layer will fall back to the Cortex-M33. If the fallback hurts your latency budget, refactor the model in the Lab or in Edge Impulse before continuing.
3. Scaffold the firmware project with FirmwareMaestro
From the fwm CLI:
fwm
> /initWhen prompted:
- Target MCU →
nRF54LM20B - Use case →
edge-ai-keyword-spotting(or whichever Edge AI recipe matches your workload) - Wireless protocol →
BLE(typical) orMatterif you're building a smart-home device
FirmwareMaestro generates:
- A Zephyr application skeleton with
CONFIG_NRF_EDGEAI_LIB=y - A Devicetree overlay for the on-board PDM microphone (or your sensor source)
- A
main.cwith NPU init, an inference work queue, and a BLE notification path - The 12 standard documents (PRD, architecture, HAL, state machine, …) pre-populated for an Edge AI workload
4. Drop in your compiled model
Copy the Axon Compiler output into the generated project:
cp generated/model.h <project>/src/model/model.h
cp generated/test_vectors.h <project>/src/model/test_vectors.hThe generated main.c already #includes these files and calls
nrf_edgeai_lib to run inference — you don't need to wire anything by
hand.
5. Build and flash
fwm
> /build nrf54lm20dk/nrf54lm20/cpuapp
> /flashOr with raw west:
west build -b nrf54lm20dk/nrf54lm20/cpuapp
west flashOpen a serial terminal at 115200 baud — you'll see the inference loop report classifications as they happen.
6. Iterate in the fwm REPL
Once the basic build is on the board, drop into /debug mode and ask
the agent to tune things:
- "My inference is taking 18 ms — show me which layers fall back to the CPU and suggest a smaller architecture."
- "The MFCC pre-processing is dominating my power budget — can we move it to a slower sample rate?"
- "Add a 5-second sleep window between detections so the radio stays off longer."
The agent reads the Axon Compiler report you placed in the project and
the Zephyr power profile, and suggests concrete prj.conf and code
changes.
Worked-example workloads
These are the workloads FirmwareMaestro currently has dedicated recipes for on the nRF54LM20B + Axon NPU:
- Wake-word / KWS — coin-cell-class always-on listening
- Audio event classification — door knock, glass break, alarm sound
- IMU gesture recognition — wearable taps, swipes, free-fall
- PPG-based heart-rate / SpO₂ classification — clinical-grade workloads require additional validation; see Medical wearable use case
- Vibration anomaly detection — predictive maintenance on small motors
Further reading
- nRF54LM20B SoC — silicon detail
- Axon NPU architecture — what the accelerator can and can't do
- Development tools — the full tool stack
- Predictive maintenance use case — adjacent application that can use Neuton (CPU) or Axon (NPU)
- Bluetooth Low Energy — the reporting transport for most Edge AI products