Freestanding is not a flag: building a bare-metal benchmark harness for Cortex-M4F

I wanted to know two things about a routine on a Cortex-M4F: how many cycles it costs, and how many bytes of flash it adds. Both answers are only worth having if nothing else in the image contributes to either figure. That became nucleo-bench: a bare-metal benchmarking harness for the STM32F446RE. You hand it an algorithm, it runs the thing a few million times with the core’s cycle counter running, and it tells you what that cost. No operating system, no vendor hardware abstraction layer, no vendor startup code. ...

July 17, 2026 · 10 min · 2007 words · Christian Gröling