A blog about electronics and programming
Home Programming Conditional breakpoint while debugging STM32

Conditional breakpoint while debugging STM32

by Carmine Noviello
0 comment 1.8K views 1 minutes read

It's a really common situation when working with hardware (especially while debugging asynchronous events): to stop execution while debugging only if a given event occurs. This is also called conditional breakpoint.

If you are working with the STM32 family and the CMSIS ARM package for Cortex-M processors, and your toolchain is GCC-based with GDB as debugger, you can place in your code this instruction:

GDB will automatically stop when the event occurs at that line.

This saved my life. Definitively.


You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.