Skip to main content
NM_it
Associate III
September 26, 2024
Question

STM32 Cube IDE Software Breakpoint

  • September 26, 2024
  • 2 replies
  • 1935 views

Hi,

How to put the software breakpoints in the STM32 Cube IDE. I can put only the hardware breakpoints. The hardware breakpoints has a limitation of maximum 5. We can use multiple software breakpoints in the STM8 Chips with ST Visual Development IDE or Renesas Chips CS+ IDE. Help me out of this problem.... 

 

 

Kind Regards,

Nishanth M

2 replies

TDK
Super User
September 26, 2024

A software breakpoint is added by putting a bkpt assembly instruction in the code. It requires you to recompile and upload this code with the software breakpoint to the chip. You can add a software breakpoint with the following code:

__BKPT();

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
NM_it
NM_itAuthor
Associate III
October 4, 2024

Hi,

After putting this  "__BKPT(); " Breakpoint, code is not going to next line. It is holding there. it acts as a while(1);

 

Regards,

Nishanth M

TDK
Super User
October 4, 2024

Hmm. Yes, that appears to be the case for me as well.

Unclear if this is expected behavior (unlikely), OpenGDB's fault, or some implementation issue in Eclipse or STM32CubeIDE.

 

From looking at threads online, it appears Segger's tools are better is this regard.

stm32 - How to resolve: failed to insert all hardware breakpoints; you may have requested too many hardware breakpoints/watchpoints - Stack Overflow

"If you feel a post has answered your question, please click ""Accept as Solution""."
Pavel A.
Super User
October 6, 2024

By the way... how these unlimited breakpoints work? The real flash breakpoints are decoded by something in the MCU itself, this is why they are limited.