Espressif ESP32-C6-DevKitM-1 does not have on-board debug probe and IS NOT READY for debugging
However the C6 DevKitM-1 comes with two USB-C ports, one UART and one JTAG, according to Espressif’s manual:
The USB Type-C port on the ESP32-C6 chip […] is used for power supply to the board, for flashing applications to the chip, for communication with the chip using USB protocols, as well as for JTAG debugging.
To me this sounds like I should be able to use that USB port directly to debug the application, however I can’t get the debugger connected. I don’t really know what to use as debug_tool though. I’ve tried esp-bridge and esp-builtin as those sounded most promising, but that didn’t seem to do anything.
I haven’t tried it (I don’t make bugs, so I don’t need a debugger - ya, right - but you should be able to follow the better documented trail for the S2 and S3 variants. There are a number of posts like
…and many more. There are even a few YouTube videos on the topic.
It SHOULD work like S3 and S3, but given the current state of support for the newer Espressif parts, I wouldn’t die of shock if some needed configuration file in platformio itself hasn’t added it to a table of targets to start openocd or whatever.
I don’t have a C6, so I can really only cheerlead.
So I’ve got this working (more or less) by manually pointing to the latest open ocd release. I downloaded the release, copied the package.json from the current version into the new one and then added this entry to the platform.ini:
This works as long as I attach the debugger via “PIO Debug (without uploading)”, otherwise it fails.
Another annoyance with this with the C6 dev kit that I noticed is that the serial output goes through the UART port and the JTAG is on the other port, so you can’t debug and look at the serial output via the same connection. I’ve not yet figured out how to make this nicer other than manually switching the port in VSCode every time depending on what I want to do.