2025-11-18 2:26 PM
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"
2025-11-18 2:43 PM
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.
2025-11-18 2:45 PM
or you can Delete all previous breakpoints
Inside CubeIDE:
Window → Show View → Breakpoints → Remove All
Sometimes stale breakpoints from previous sessions cause the error.