Journal / Edge AI
Edge AI on STM32 in 2026: choosing the right microcontroller for your model
The costliest edge AI mistake is picking the chip before understanding the model. How we match workloads to STM32N6, H7, U5 and L4, and the pipeline from data to production firmware.
Two years ago, "AI on a microcontroller" mostly meant keyword spotting demos. In 2026 it means production products: motor drives that diagnose their own bearings, cameras that inspect parts without a PC, meters that read themselves. The silicon caught up, and so did the tooling.
But the most expensive mistake we still see is the first one: picking the microcontroller before understanding the model. Teams choose a part from the last product, train a network on a laptop, and discover three months later that it needs four times the RAM the chip has.
This guide is how we approach that decision at Saola.
Start from the workload, not the part
Before looking at a datasheet, write down four numbers:
- Input size and rate. A 3-axis accelerometer at 1.6 kHz is a few kilobytes per second. A 320 × 240 colour camera at 15 fps is over a megabyte per second per frame buffer.
- Latency budget. How quickly does a decision have to happen? Ten milliseconds for a safety interlock is a different problem from ten seconds for a fill-level estimate.
- Power budget. Mains-powered, or a coin cell that has to last three years?
- Accuracy floor. The minimum accuracy at which the product is still worth shipping. This is a business number, not a research number.
These four numbers narrow the field faster than any feature comparison.
The STM32 families we reach for
STM32 is not one chip, and for edge AI the families fall into clear roles.
STM32N6: when you need vision
The N6 is ST's first STM32 with a dedicated neural processing unit, the Neural-ART Accelerator, next to an Arm Cortex-M55 core. It also brings a camera pipeline (MIPI CSI-2 and an image signal processor) and a large block of on-chip RAM.
That combination matters. Image models are dominated by convolution, which is exactly what an NPU accelerates, and having the camera interface on the same chip removes a whole processor from the bill of materials. If your product looks at the world, start your evaluation here.
STM32H7: heavy DSP and mid-sized networks
The H7 family's high-clock Cortex-M7 cores are the workhorse for signal-heavy problems: vibration and current analysis, audio, radar pre-processing. Many of these models are small after feature extraction, but the DSP in front of them (FFTs, filters, spectrograms) needs real compute.
STM32U5 and STM32L4: always-on, battery-powered sensing
For sensor nodes that wake, infer and sleep, the low-power families win. The U5 adds Arm TrustZone and hardware security features on a Cortex-M33, which matters once the device is connected. A well-designed anomaly detector on vibration features can run comfortably here at a tiny fraction of the energy budget.
The pipeline, end to end
A reliable edge AI project follows the same shape every time.
1. Data that looks like the field. Most failures trace back to training data collected on a bench, with a clean power supply and a new sensor. Record on the real machine, in the real enclosure, across shifts and seasons.
2. A model designed for the target. Depthwise-separable convolutions, small input resolutions and compact feature extractors are not compromises; they are the design. Start small and grow only if accuracy demands it.
3. Quantisation. Converting weights and activations from 32-bit floats to 8-bit integers typically shrinks a model by around four times and lets it use integer and NPU hardware. Use quantisation-aware training if post-training quantisation costs too much accuracy.
4. Conversion and benchmarking on real silicon. ST's Edge AI Suite (which includes the tools previously known as STM32Cube.AI) converts TensorFlow Lite, Keras and ONNX models into optimised C code for STM32 and reports flash, RAM and inference time. The ST Edge AI Developer Cloud lets you benchmark on real boards before you own them. We treat these numbers as the source of truth, never the laptop.
5. Firmware around the model. The network is often less than half the work. Sensor drivers, the pre-processing chain, scheduling, low-power states, logging and a safe update path are what turn a model into a product.
Five mistakes we help teams avoid
- Measuring accuracy only on the training PC. Quantised, on-device accuracy is the only number that ships.
- Forgetting the pre-processing budget. An FFT or image resize can cost more cycles than the network itself.
- Assuming RAM is the same as flash. Activations live in RAM. A model that fits in flash can still fail to run.
- No path to update the model. Field data will show you edge cases. Without secure over-the-air updates, you can't act on them.
- Treating security as a later phase. Secure boot, signed firmware and key storage are far cheaper to design in than to retrofit, and regulations like the EU Cyber Resilience Act now expect them.
Where to start
If you already have a model or a dataset, the fastest way to de-risk the project is a feasibility sprint: convert the model, run it on two or three candidate STM32 parts, and get hard numbers for accuracy, latency, memory and power. That turns "can this run on a microcontroller?" into a yes or no with evidence, usually before any custom hardware is designed.
That is exactly the work we do at Saola. If you're weighing up edge AI for a product, tell us about it.
Weighing up edge AI for a product? Let’s run the numbers.
Book a feasibility call →Keep reading
