Sysprogs forums › Forums › VisualGDB › ESP32 – Cannot set hardware breakpoint
Tagged: ESP32 breakpoint
- This topic has 5 replies, 2 voices, and was last updated 9 years ago by
support.
-
AuthorPosts
-
January 7, 2017 at 12:10 #9959
nevyn
ParticipantI have an ESP32 board which I programmed with successfully and managed to set two hardware breakpoints following the advice in the ESP32 Limitations article.
I have now setup a second project based upon the LED project and have tried to execute this and set a breakpoint. I keep getting the following message:
Cannot insert hardware breakpoint 7.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.I have tried clearing the break points using Visual Studio (Debug -> Delete all breakpoints) and also using the GDB session directly. The GDB command info break tells me that I have no breakpoints or watchpoints set.
Any idea how I can use the debugger in the new application?
Thanks in advance,
MarkJanuary 7, 2017 at 19:58 #9969support
KeymasterHi,
The ESP32 OpenOCD sometimes shows this message if one of the cores is not stopped properly. Please try running the “mon targets” command to see if both cores are stopped. You can then forcibly stop them by running “mon halt”.
January 8, 2017 at 11:04 #9974nevyn
ParticipantI have just retried programming the chip and debugging as follows:
- Set project properties to Alway program, compiled the code.
- Reset the chip and hit debug to upload the code.
- Once complete I reset the properties to Assume programmed, reset the chip and then pressed F5.
Doing this generates a SIGINT exception and the source windows shows the breakpoint in xPortGetCoreID method.
If I run without the debugger attached and check the output on the COM port I get the following message:
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
along with a register dump and traceback. The chip then enters a cycle of software resets as the same error is generated over and over again.
BTW – I’m using a Segger J-Link EDU.
Regards
MarkJanuary 8, 2017 at 17:44 #9977support
KeymasterHi,
Looks like you might be compiling the code with the -O0 optimization level that triggers a bug in the ESP32-IDF.
Please try switching it to -Og via Visual Studio Project Properties -> C/C++ -> Optimization.
January 9, 2017 at 08:39 #9985nevyn
ParticipantThe -Og change solved it. Thought I’d followed the tutorial carefully, can’t believe I missed that.
Thanks for the help,
MarkJanuary 10, 2017 at 03:32 #9998support
KeymasterHi,
No problem. This is somewhat counter-intuitive and we will probably add a warning for this in one of the later releases.
-
AuthorPosts
- You must be logged in to reply to this topic.