IT lexicon › Hardware › Hardware breakpoint

Hardware breakpoint

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

A breakpoint implemented by an address comparator in the CPU's debug unit, rather than by rewriting the code.

A software breakpoint works by having the debugger swap an instruction for a trap — BKPT on ARM, INT3 on x86. That requires the code to sit in writable memory. On a microcontroller executing straight from flash you can't do it without erasing and rewriting a whole page, so the hardware instead compares each fetched instruction address against a handful of registers and halts the core on a match.

On Cortex-M this is the job of the FPB unit, and comparators are scarce: typically four on an M0 and six on an M3 or M4. Ask for one more and you get a "cannot insert breakpoint" error, or a debugger that silently starts single-stepping instead. The data-access counterpart is the watchpoint, provided by the DWT. In GDB the command is hbreak.

← Back to the lexicon