Debugging with OpenOCD and GDB
Posted: Mon Jan 30, 2017 9:34 pm
Ever since I started working with the esp32 I haven't been able to debug properly.
I'm using a LoPy and a olimex arm-usb-ocd-h.
I'm building and debugging with VisualGDB.
I already posted about this problem on their forum.
https://sysprogs.com/w/forums/topic/esp ... t-halting/
Alot of nagging about not being able to set breakpoints. Not hitting breakpoints at all. Almost hitting the breakpoint, actually stopping the line before the breakpoint but this is not communicated to the debugger.
I had a conversation about this on IRC, with Sprite_tm and his conclusion was that it was a issue caused by the openocd included in VisualGDB if I'm not mistaken.
So I went ahead and tried debugging on a linux system after having built openocd. It seemed to work better. On I went trying to cross-compile for windows. I couldn't figure out how/didn't have time to fix all the errors in the make stage. Using the msys2 environment it was alot easier building openOCD thank god.
So I had the latest build of openOCD and I started debugging a program I had built with VisualGDB.
(I'm unable to flash the program using VisualGDB using this version of openocd, but I guess thats another issue.)
I am still stuck with the debug controller resetting randomly:
The program halts at the scheduler start, and I continue. The debug controller resets and I press CTRL+C.
Sometimes the breakpoint does hit but the thread is gone:
OpenOCD output:
And I'm unable to issue any other gdb commands to the jtag debugger.
VisualGDB is also behind on the newest esp-idf which is also killing me, very, very slowly.
Full gdb output: http://pastebin.com/Gt6HPF0F
Full OpenOCD output: http://pastebin.com/RMQ8XvxB
Any help would be appreciated! all these issues stacking on top of each other isn't speeding up development ='(
I'm using a LoPy and a olimex arm-usb-ocd-h.
I'm building and debugging with VisualGDB.
I already posted about this problem on their forum.
https://sysprogs.com/w/forums/topic/esp ... t-halting/
Alot of nagging about not being able to set breakpoints. Not hitting breakpoints at all. Almost hitting the breakpoint, actually stopping the line before the breakpoint but this is not communicated to the debugger.
I had a conversation about this on IRC, with Sprite_tm and his conclusion was that it was a issue caused by the openocd included in VisualGDB if I'm not mistaken.
So I went ahead and tried debugging on a linux system after having built openocd. It seemed to work better. On I went trying to cross-compile for windows. I couldn't figure out how/didn't have time to fix all the errors in the make stage. Using the msys2 environment it was alot easier building openOCD thank god.
So I had the latest build of openOCD and I started debugging a program I had built with VisualGDB.
(I'm unable to flash the program using VisualGDB using this version of openocd, but I guess thats another issue.)
I am still stuck with the debug controller resetting randomly:
Code: Select all
(gdb) c
Continuing.
esp32.cpu0: Debug controller was reset (pwrstat=0xFF, after clear 0xFF).
esp32.cpu0: Core was reset (pwrstat=0xFF, after clear 0xFF).
esp32.cpu1: Debug controller was reset (pwrstat=0xFF, after clear 0xFF).
esp32.cpu1: Core was reset (pwrstat=0xFF, after clear 0xFF).
esp32.cpu0: Debug controller was reset (pwrstat=0xE5, after clear 0x5F).
esp32.cpu0: Target halted, pc=0x40080A80
Program received signal SIGTRAP, Trace/breakpoint trap.
0x40080a80 in ?? ()
Sometimes the breakpoint does hit but the thread is gone:
Code: Select all
(gdb) hb ble.cpp:91
Hardware assisted breakpoint 1 at 0x4014e77e: file ble.cpp, line 91.
(gdb) c
Continuing.
esp32.cpu0: Target halted, pc=0x4014E77E
[Switching to Thread 1073676856]
(gdb)
Code: Select all
Error: FreeRTOS: uxTopUsedPriority is not defined, consult the OpenOCD manual for a work-around
VisualGDB is also behind on the newest esp-idf which is also killing me, very, very slowly.
Full gdb output: http://pastebin.com/Gt6HPF0F
Full OpenOCD output: http://pastebin.com/RMQ8XvxB
Any help would be appreciated! all these issues stacking on top of each other isn't speeding up development ='(