ESP32 and JTAG debugging support

Hi, excellent work on the IDE, very nice!

Will there be support for the Espressif JTAG hardware debugger in the new IDE? Right now when I hover over the debug icon on top of the page I see a message saying "Debug - Debugging not supported for 'board name'", where the board name is NodeMCU-32S or any other board. I've tried several different boards that somewhat match my ESP32 and get the same message.

If I click the debug icon on the left side of the screen I see what looks like debugging options, but I click on add configurations I see several Cortex options, nothing indicating JTAG. Sorry, not familiar with Cortex. Maybe I just don't know what I'm looking at.

Thoughts, suggestions, etc?

Thank you!

Hi @fischpj.

There are two requirements for support to be available for use of the Arduino IDE integrated debugger with the ESP32 boards:

  • The debugger extension must have support for the ESP32 target
  • The ESP32 boards platform authors must configure their platform to provide the necessary information to the debugger

I don't know about the former. The Arduino IDE 2.x integrated debugger is this nice VS Code extension:

As the name and description imply, it is targeted to ARM Cortex cores, which the ESP32 does not use. However, there is an interesting discussion about extending its capabilities here:

https://github.com/Marus/cortex-debug/issues/13#issuecomment-381001391

As for supporting other MCUs that are not Cortex-M based - I'm not really opposed to the idea.


As for the latter, at least for the platforms of boards that use an ARM Cortex-M core, the work is very minimal. Unfortunately Arduino has not documented the process, but it is demonstrated in the open source configuration files of the official "Arduino SAMD Boards" platform. You can see the only changes that were required here:

https://github.com/arduino/ArduinoCore-samd/commit/cf72acfe1b74c2e00d77dcba65f664bd09582c65

and here:

https://github.com/arduino/ArduinoCore-samd/blob/1.8.13/platform.txt#L129-L140


Despite the ease of doing so for the popular ARM Cortex-M microcontrollers, I'm not aware of any 3rd party boards platforms that have added support. I do keep an eye out for such things, but there are hundreds of them so I might well have missed one.

For now, if you want to use the debugger you should use one of the boards supported by the "Arduino SAMD Boards" platform.

The Zero is the most convenient due to having a built-in debugger on board. So it's really a "plug and debug" experience. The second most convenient is the MKR1000, due to it having a standard SWD header on the board that makes it easy to connect an external debug probe. The rest of the MKR boards have the SWD pins broken out to a footprint for an SMT 2x3 0.1" pitch pin header on the bottom of the board. This is a bit annoying to make the connections to, but manageable. Dead last is the Nano 33 IoT, which breaks its SWD pins out to some small test pads on the bottom of the board. This requires either need to soldering wires to the pads or else setting up a pogo pin jig.

Ptillisch,

Thank you so much for your reply. I'll take a look at what's been done and give implementing the debugger a try. I'm currently "married" to the ESP32 so, that's the platform I need to work with.

I imagine it's not that difficult as you stated, since the other VS Code Arduino PlatformIO has debugging support.

Thank you

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.