STM32N657 as a drone flight controller: NPU inference next to an 8 kHz control loop (notes + two questions)
We’ve been running a flight controller on the STM32N657 and wanted to share some measurements and ask about two things we’re unsure of.
Setup: OV9281 global-shutter camera (120 fps, 320 x 240) over CSI-2 into DCMIPP, an INT8 gate-detection network on the Neural-ART NPU, policy + state estimator on the Cortex-M55 with Helium, attitude loop at 8 kHz.
Measured on our engineering sample:
- CSI-2 DMA into SRAM + ISP: 0.41 ms
- NPU inference (INT8): 1.92 ms
- Policy MLP + state estimator: 0.06 ms
- Mixer + bidirectional DShot: 0.13 ms
Camera to motor command is about 10.8 ms, dominated by the 8.3 ms frame interval.
Questions:
1. When the NPU and the M55 both hit XSPI-mapped memory (we keep frame buffers and activations in external PSRAM), what's the recommended way to keep control-loop ISR jitter low? Loop code and its data already sit in internal SRAM; is there anything on the bus/arbitration side we should know about?
2. Is there an ST example that feeds DCMIPP output straight into the NPU input buffer, and has anyone measured how much that saves versus going through an intermediate buffer?
Happy to share more detail if it's useful to others.
--
Štěpán Kaiser, Remānguys (maker of the SILM N6 board: https://silm-n6.honza-071.workers.dev/?ref=st)
