ESP32-WROOM-32 problem when JTAG debugging with ESP-Prog

Hi All

Last week I received an ESP-PROG to allow me to use JTAG debugging with my ESP32 Dev Board.

To test the ESP-PROG board I created a new Arduino project in PlatformIO, loaded the BLINK code and all worked as expected. Build, Upload, debug, breakpoints…

Now this weekend as I am working on my real project code I am getting the following error in the debugger.

/builds/idf/crosstool-NG/.build/src/gdb-7.10/gdb/regcache.c:697: internal-error: 
regcache_raw_read_unsigned: Assertion `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed.
A problem internal to GDB has been detected, further debugging may prove unreliable.
Quit this debugging session? 

When I close the project and open the BLINK test sketch it works fine. I have used the same PlateformIO.ini file for both the test BLINK and my project code.

Any suggestions on what I should be looking for here?

Thanks Dave

PlatformIO Core 5.1.1
Espressif32 3.3.1

VS Code Version: 1.60.0 (user setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

PlatformIO.ini

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
upload_port = com5
monitor_speed = 115200

; ESP-PROG JTAG
debug_tool = esp-prog 
debug_init_break = tbreak setup
board_debug.openocd_board = esp32-wrover-kit-1.8v.cfg
debug_speed = 12000

** note using the 1.8v cfg to fix the reboot loop problem with the GPIO12

I think you’ll get a better answer from the Espressif people who work on ESP32 OpenOCD and GDB version rather than this general forum – English Forum - ESP32 Forum

Or directly Issues · espressif/openocd-esp32 · GitHub or Issues · espressif/crosstool-NG · GitHub.

Hi Max

Thanks for the advice, I will repost there.

Dave

Hi Max

I actually found the fix in another one of your posts, as below. I was removing PIO from VS Code but removing the directory did the trick.

Does this occur after a fresh reinstall too? To do that,

  • remove the PlatformIO extension from VSCode and close VSCode
  • remove the folder C:\Users\User\.platformio\
  • re-open VSCode, reinstall PlatformIO, restart VSCode after installation has finished
  • retry building the project first, then debugging.

Thanks Dave

1 Like