Stuck with debugging ESP32-S3 in VS-Code
Posted: Fri Oct 07, 2022 6:05 am
Hi,
I bought a ESP32-S3 development board to test the USB connection for flashing/debugging and I can flash to the board, but am stuck debugging it. The documentation only mentions steps for eclips and the command line to work.
I am working on a Mac, updated to the latest master IDF. (ESP-IDF v5.1-dev-992-gaf28c1fa21)
My launch.json:
Inside Vscode I start openocd one time:
That results in:
What to do?
I bought a ESP32-S3 development board to test the USB connection for flashing/debugging and I can flash to the board, but am stuck debugging it. The documentation only mentions steps for eclips and the command line to work.
I am working on a Mac, updated to the latest master IDF. (ESP-IDF v5.1-dev-992-gaf28c1fa21)
My launch.json:
Code: Select all
{
"version": "0.2.0",
"configurations": [
{
"name": "ESP32 OpenOCD",
"type": "cppdbg",
"request": "launch",
"miDebuggerPath": "/Users/remyhurx/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gdb",
"cwd": "${workspaceFolder}/build",
//change the name of the elf file as required
"program": "/Users/remyhurx/Esp-proj/testdebug/build/testdebug.elf",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"text": "target remote :3333"
},
{
"text": "set remote hardware-watchpoint-limit 2"
},
{
"text": "monitor reset halt"
},
{
"text": "flushregs"
}
],
"externalConsole": false,
"logging": {
// "trace": true,
// "traceResponse": true,
//"engineLogging": true
}
}
]
}
Code: Select all
openocd -f board/esp32s3-builtin.cfg
Then when I build, flash and monitor everything goes well. I go to the debug part at the left.(Run and debug). Press the green play button with the profile next to it and it returns:Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Warn : Transport "jtag" was already selected
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : esp_usb_jtag: serial (7C:DF:A1:E0:9F:C8)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
In the terminal:Unable to start debugging. Program path '/Users/remyhurx/Esp-proj/testdebug/build/testdebug.elf' is missing or invalid.
GDB failed with message: I'm sorry, Dave, I can't do that. Symbol format `elf32-xtensa-le' unknown.
This may occur if the process's executable was changed after the process was started, such as when installing an update. Try re-launching the application or restarting the machine.
Warn : No symbols for FreeRTOS!
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Set GDB target to 'esp32s3.cpu0'
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 41 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 116 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Auto-detected flash bank 'esp32s3.cpu0.flash' size 8192 KB
Info : Using flash bank 'esp32s3.cpu0.flash' size 8192 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 41 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 116 KB
Info : Using flash bank 'esp32s3.cpu0.irom' size 120 KB
Info : [esp32s3.cpu0] Target halted, PC=0x403B2482, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 41 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 116 KB
Info : Using flash bank 'esp32s3.cpu0.drom' size 44 KB
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
Warn : negative reply, retrying
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] requesting target halt and executing a soft reset
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [esp32s3.cpu0] Core was reset.
Info : [esp32s3.cpu0] Target halted, PC=0x500000EF, debug_reason=00000000
Info : [esp32s3.cpu1] requesting target halt and executing a soft reset
Info : [esp32s3.cpu0] Core was reset.
Info : [esp32s3.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
Info : [esp32s3.cpu1] Target halted, PC=0x40000400, debug_reason=00000000
Info : dropped 'gdb' connection
What to do?