Skip to main content
Ddu P
Associate III
Dec 10, 2020 1:15 PM UTC
Solved

Disable Breakpoints in Release Build

How can I disable breakpoints for release builds? If I accidentally forget a breakpoint on, and it gets hit in the release build, then the program just freezes (including halting the watchdog timer!) - what am I missing?

This topic has been closed for replies.
Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
Dec 11, 2020 8:03 AM UTC

Nothing related to build here but debug / run. Having breakpoint set is not leading to any compile result variation.

If you're expecting to run your application getting rid of existing breakpoints just disable them Thanks "Run > Skip All BreakPoints" or dedicqted toolbar shortcut icon:

0693W000006FOwIQAW.jpg 

6 replies

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
Dec 11, 2020 8:03 AM UTC

Nothing related to build here but debug / run. Having breakpoint set is not leading to any compile result variation.

If you're expecting to run your application getting rid of existing breakpoints just disable them Thanks "Run > Skip All BreakPoints" or dedicqted toolbar shortcut icon:

0693W000006FOwIQAW.jpg 

Ddu P
Ddu PAuthor
Associate III
Dec 11, 2020 9:10 AM UTC

Thanks! :)

I did see the "Skip All Breakpoints", which I've now taken to enabling before building (still not an ideal solution however).

"Nothing related to build here"

I would have thought so, but that does not seem to be what I am seeing! I am guessing that the hardware breakpoints are being hit, even though I don't have the debugger running (it is still plugged in however).

Cartu38 OpenDev
Graduate II
Dec 11, 2020 10:12 AM UTC

Sure some impact if whole process but no impact on compiler produced binary.

Please mark as answered if ok to you. It will help community to dig shortly into valuable material.

Pavel A.
Dec 11, 2020 12:04 PM UTC

>  then the program just freezes

When debugger is not active, the breakpoint instruction causes "debug monitor" exception.

If it is not specially enabled it escalates to hardfault. So you're getting a hardfault.

The simplest is not to use breakpoint instructions in release configuration.

Or, in release mode you can enable the "debug monitor" handler and dismiss these exceptions (complicated).

-- pa

Ddu P
Ddu PAuthor
Associate III
Dec 16, 2020 9:52 PM UTC

This is helpful info, thank-you. Why does the WDT not reset the chip once the hard-fault is hit? (Or perhaps it does, and the continual resetting looked to me like a hang - I would have to retest to verify.)