IT lexicon › Hardware › Flash algorithm

Flash algorithm

Hardware På svenska → Updated: 2026-11-05

A small program the debugger loads into the target's RAM to erase and write flash, because flash can't be written like ordinary memory.

A debug probe can read and write RAM directly, but flash needs sector erases, unlock sequences and timing-sensitive pokes at the chip's flash controller — all different for every family. Rather than teach every debugger every chip, the tool uploads a ready-made routine exposing functions like Init, EraseSector and ProgramPage, lets the target's own CPU run it, and feeds it data through a RAM buffer.

Keil's .FLM format — an ELF file shipped inside a CMSIS-Pack — has become something of a de facto standard; pyOCD and probe-rs run them as-is. OpenOCD goes its own way with flash drivers written in C. When programming hangs on a new chip, it is nearly always the algorithm, not the probe.

← Back to the lexicon