Need some help setting up a debugging environment (in VSCode) #104
-
Hey everyone, i'm currently in the process of trying out rust on an esp32 (specifically the ESP32-S2-Saola-1R) and found this book to be a great entry point. However i'm having some trouble setting up a debugging environment. I'm using an ESP-PROG as JTAG adapter, connected to the pins mentioned in the Hardware Setup section of the book. I have the cortex-debug extension installed and also installed esp-idf (from the AUR package). I created a {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
// more info at: https://github.com/Marus/cortex-debug/blob/master/package.json
"name": "Attach",
"type": "cortex-debug",
"request": "attach", // attach instead of launch, because otherwise flash write is attempted, but fails
"cwd": "${workspaceRoot}",
"executable": "target/xtensa-esp32s2-espidf/debug/test-project",
"servertype": "openocd",
"interface": "jtag",
"svdFile": "/home/<my_user>/esp32/svd/svd/esp32s2.svd",
"toolchainPrefix": "xtensa-esp32-elf",
"armToolchainPath": "/home/<my_user>/.espressif/tools/xtensa-esp32-elf/esp-2022r1-11.2.0/xtensa-esp32-elf/bin/",
"openOCDPreConfigLaunchCommands": [
"set ESP_RTOS none"
],
"serverpath": "/usr/bin/openocd-esp32openocd",
"configFiles": [
"board/esp32s2-kaluga-1.cfg"
],
"overrideAttachCommands": [
"set remote hardware-watchpoint-limit 2",
"mon halt",
"flushregs"
],
"overrideRestartCommands": [
"mon reset halt",
"flushregs",
"c",
]
},
]
} I have also tried the "toolchainPrefix": "xtensa-esp32s2-elf",
"armToolchainPath": "/home/janek/.espressif/tools/xtensa-esp32s2-elf/esp-2022r1-11.2.0/xtensa-esp32s2-elf/bin/", However nothing is happening, when i launch the configuration it loads for a while and than just exits again, this is the output from the VSCode Debug Console:
Any help with this would be greatly apreciated. Cheers |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Update: I'm stupid. Seems like the ESP32-S2 uses different JTAG pins (see here). After wiring it correctly i can properly attach to a debugging session. However i still have to figure out how to properly flash the chip and than attach the debugging session, but it seems like this should be doable with openocd (see here) |
Beta Was this translation helpful? Give feedback.
Yes, you need to have two USB cables!