cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32mp1 : constantly getting "failed to insert all hardware breakpoints; you may have requested too many hardware breakpoints/watchpoints

embeddedbro
Associate III

hi, I'm trying to debug stm32mp157f-dk2 by using stm32cubeide by using open OCD and gdb

After connection, I'm constantly getting below error.

I can't even single step in or run. 

 

"failed to insert all hardware breakpoints; you may have requested too many hardware breakpoints/watchpoints"

2 REPLIES 2
__Mohamed__Ayman__ST
Associate II

The Cortex-A7 inside STM32MP157F has a limited number of hardware breakpoints:

  • 6 hardware breakpoints total

  • 4 hardware watchpoints

If GDB or OpenOCD tries to place more breakpoints than available, you get:

"failed to insert all hardware breakpoints; you may have requested too many"

And on STM32MP1, OpenOCD sometimes tries to set breakpoints in ROM or non-writable memory, causing the same error.

 

You can Enable Software Breakpoints

Go in STM32CubeIDE:

Run → Debug Configurations → Debugger tab

Check: “Use Software Breakpoints”

This avoids hardware breakpoint limits.

__Mohamed__Ayman__ST
Associate II

or you can Delete all previous breakpoints

Inside CubeIDE:

Window → Show View → Breakpoints → Remove All

Sometimes stale breakpoints from previous sessions cause the error.