Zephyr Computer Vision application demonstrating the deployment of object detection models on the STM32N6570-DK.
- NPU-accelerated quantized AI model inference under Zephyr on STM32N6570-DK
The following commands show how to install and build this application, assuming that the Zephyr SDK and host tools are installed:
$ mkdir workspace
$ cd workspace
workspace $ west init -m https://github.com/stm32-hotspot/zephyr-stm32n6-ai-people-detection
workspace $ west updateworkspace $ cd zephyr-stm32n6-ai-people-detection
workspace/zephyr-stm32n6-ai-people-detection $ west build app -pworkspace $ cd zephyr-stm32n6-ai-people-detection
workspace/zephyr-stm32n6-ai-people-detection $ west build -b stm32n6570_dk --sysbuild app -DSB_CONFIG_MCUBOOT_MODE_RAM_LOAD=y -pThis needs to be done once (unless you update the model).
Set your board to development mode.
Ensure no ST-LINK_gdbserver is running
workspace/zephyr-stm32n6-ai-people-detection $ west flash-weightsSet your board to development mode.
workspace/zephyr-stm32n6-ai-people-detection $ west debug
...
Transfer rate: 698 KB/sec, 6890 bytes/write.
(gdb) c
Continuing.You should see the following output on the console
[00:00:00.341,000] <inf> flash_stm32_xspi: XSPI flash config is OCTO / DTR
[00:00:00.341,000] <inf> flash_stm32_xspi: Read SFDP from externalFlash
[00:00:00.341,000] <inf> flash_stm32_xspi: Read SFDP from externalFlash
[00:00:00.341,000] <inf> flash_stm32_xspi: Memory-mapped NOR-flash at 0x70000000 (0x8000000 bytes)
evision ST-AE v1.0.5
evision AWB v1.0.5
evision ST-AE v1.0.5
evision AWB v1.0.5
evision ST-AE v1.0.5
evision AWB v1.0.5
*** Booting Zephyr OS build v4.2.0 ***
[00:00:00.462,000] <inf> model: Npu subsystem ready
[00:00:00.466,000] <inf> main: buffer 0x3405c198(0x900bb910) queue to endpoint@1 pipe
[00:00:00.466,000] <inf> main: buffer 0x3405c1b8(0x90177120) queue to endpoint@1 pipe
[00:00:00.466,000] <inf> main: buffer 0x3405c1d8(0x90232940) queue to endpoint@2 pipe
[00:00:00.466,000] <inf> main: buffer 0x3405c1f8(0x90257560) queue to endpoint@2 pipe
[00:00:00.466,000] <inf> main: Starting main pipe
[00:00:00.471,000] <inf> main: Starting aux pipe
[00:00:00.475,000] <inf> main: STARTING
Set your board to development mode.
Ensure no ST-LINK_gdbserver is running.
workspace/zephyr-stm32n6-ai-people-detection $ west flashSet your board to boot from flash. Then perform a power off/on sequence.
You should see the following output on the console
*** Booting MCUboot v2.1.0-rc1-389-g4eba8087fa60 ***
*** Using Zephyr OS build v4.2.0 ***
I: Starting bootloader
I: Primary slot: version=0.0.0+0
I: Image 0 Secondary slot: Image not found
I: Image 0 RAM loading to 0x34000000 is succeeded.
I: Image 0 loaded from the primary slot
I: Bootloader chainload address offset: 0x34000000
I: Image version: v0.0.0
I: Jumping to the first image slot
[00:00:00.201,000] <err> flash_stm32_xspi: NOR init'd in MemMapped mode
evision ST-AE v1.0.5
evision AWB v1.0.5
evision ST-AE v1.0.5
evision AWB v1.0.5
evision ST-AE v1.0.5
evision AWB v1.0.5
*** Booting Zephyr OS build v4.2.0 ***
[00:00:00.322,000] <inf> model: Npu subsystem ready
[00:00:00.326,000] <inf> main: buffer 0x3405c4f8(0x900bb910) queue to endpoint@1 pipe
[00:00:00.326,000] <inf> main: buffer 0x3405c518(0x90177120) queue to endpoint@1 pipe
[00:00:00.326,000] <inf> main: buffer 0x3405c538(0x90232940) queue to endpoint@2 pipe
[00:00:00.326,000] <inf> main: buffer 0x3405c558(0x90257560) queue to endpoint@2 pipe
[00:00:00.326,000] <inf> main: Starting main pipe
[00:00:00.331,000] <inf> main: Starting aux pipe
[00:00:00.335,000] <inf> main: STARTING
The STM32N6 series does not have internal flash memory. To retain firmware after a reboot, program it into the external flash. Alternatively, you can load firmware directly into SRAM (development mode), but note that the program will be lost if the board is powered off in this mode.
Development Mode: Used for loading firmware into RAM during a debug session or for programming firmware into external flash.
Boot from Flash: Used to boot firmware from external flash.
| Boot from flash | ![]() |
| Development mode | ![]() |

