-
Notifications
You must be signed in to change notification settings - Fork 150
Description
Development Kit
esp32s3_devkitc
Module or chip used
esp32s3
Debug Adapter
Built in JTAG
OpenOCD version
v0.12.0-esp32-20250707-1-gd1c88229
Operating System
Windows/WSL
Using an IDE ?
Yes, VSCode
OpenOCD command line
openocd \ -f board/esp32s3-builtin.cfg \ -c "set ESP32_ONLYCPU 1; set ESP_FLASH_SIZE 0; set ESP_RTOS Zephyr" \ -c "init; halt; esp appimage_offset 0x20000" \ -c "esp32s3.cpu0 configure -rtos Zephyr" \ -c "init" \ -c "reset init"
JTAG Clock Speed
default
ESP-IDF version
N/A - Using Zephyr OS build v4.1.0-rc3-134-g3d0a7dab1a97
Problem Description
So, here's my situation
- I am trying to debug an application running on what Zephyr refers to as
procpuoresp32s3.cpu0by gbd/openocd terms. - I am compiling the project using
sysbuild, and I am NOT using the otherappcpucore. - I have the option
CONFIG_DEBUG_THREAD_INFO=ywhich turns on the symbols for openocd, and i can confirm that the symbols are being built into the elf, as shown below
$ /usr/local/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/bin/xtensa-espressif_esp32s3_zephyr-elf-nm build/runtime/zephyr/zephyr.elf |grep -i openocd
3c01400c R _kernel_openocd_num_offsets
3c014010 R _kernel_openocd_offsets
3c014008 R _kernel_openocd_size_t_size
- I have downloaded, compiled, and install
openocd-esp32, and the version is stated above. - When I try to start
openocd, all is good
$ openocd \
-f board/esp32s3-builtin.cfg \
-c "set ESP32_ONLYCPU 1; set ESP_FLASH_SIZE 0; set ESP_RTOS Zephyr" \
-c "init; halt; esp appimage_offset 0x20000" \
-c "esp32s3.cpu0 configure -rtos Zephyr" \
-c "init" \
-c "reset init"
Open On-Chip Debugger v0.12.0-esp32-20250707-1-gd1c88229 (2025-07-08-05:49)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Zephyr
Info : esp_usb_jtag: serial (84:F7:03:A0:0A:F0)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 40000 kHz
Info : JTAG tap: esp32s3.tap0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.tap1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] Examination succeed
Info : [esp32s3.cpu1] Examination succeed
Info : [esp32s3.cpu0] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32s3.cpu0] Target halted, PC=0x42000ADC, debug_reason=00000001
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
Info : Set GDB target to 'esp32s3.cpu0'
Info : [esp32s3.cpu1] Target halted, PC=0x40043A40, debug_reason=00000000
Info : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
Info : [esp32s3.cpu0] Target halted, PC=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
Info : Using flash bank 'esp32s3.cpu0.irom' size 56 KB
Info : [esp32s3.cpu0] Target halted, PC=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
Info : Using flash bank 'esp32s3.cpu0.drom' size 20 KB
Info : [esp32s3.cpu0] Target halted, PC=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
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=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
Info : Using flash bank 'esp32s3.cpu1.irom' size 56 KB
Info : [esp32s3.cpu0] Target halted, PC=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
Info : Using flash bank 'esp32s3.cpu1.drom' size 20 KB
Info : [esp32s3.cpu0] Target halted, PC=0x4038CCA2, debug_reason=00000001
Info : Flash mapping 0: 0x50000 -> 0x3c010000, 18 KB
Info : Flash mapping 1: 0x40000 -> 0x42000000, 54 KB
Info : Auto-detected flash bank 'esp32s3.cpu1.flash' size 8192 KB
Info : Using flash bank 'esp32s3.cpu1.flash' size 8192 KB
Info : Zephyr: looking for target: esp32s3
Info : Zephyr: target known, params at 0x55e2cbd719e8
Info : JTAG tap: esp32s3.tap0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.tap1 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.cpu0] Reset cause (3) - (Software core 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 : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
- I then try to start
gdbusing thelaunch.jsonconfiguration below
{
"name": "Launch ESP32S3",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/app/zephyr/zephyr.elf",
"cwd": "${workspaceFolder}",
"stopAtEntry": true,
"MIMode": "gdb",
"miDebuggerPath": "/usr/local/zephyr-sdk-0.17.0/xtensa-espressif_esp32s3_zephyr-elf/bin/xtensa-espressif_esp32s3_zephyr-elf-gdb",
"debugServerArgs": "-f target/esp32s3-builtin.cfg",
"useExtendedRemote": true,
"miDebuggerServerAddress": "localhost:3333",
"postRemoteConnectCommands": [
{
"text": "set remote hardware-watchpoint-limit 4"
},
{
"text": "mon reset halt"
},
],
}- The debugger launches, and I get my program to halt in
main.c, and the thread info (or at least their names) appear on the side bar - a few things to note here is that theVariablestab shows the right info, and theCall Stacktab has the name of the threads, but it can be seen when expanded that there's no valid info
- When the debugger launches, the output of the
openocdconsole has the following info
Info : accepting 'gdb' connection on tcp/3333
Warn : No symbols for Zephyr
Info : New GDB Connection: 1, Target esp32s3.cpu0, state: halted
Memory Map (8 regions):
----------------------------------------
Type Start Addr Length BlockSize
----------------------------------------
FLASH 0x00000000 0x00800000 0x00001000
R/W 0x00800000 0x3b810000 0x00000000
FLASH 0x3c010000 0x00005000 0x00001000
R/W 0x3c015000 0x03feb000 0x00000000
ROM 0x40000000 0x00060000 0x00000000
R/W 0x40060000 0x01fa0000 0x00000000
FLASH 0x42000000 0x0000e000 0x00001000
R/W 0x4200e000 0xbdff2000 0x00000000
----------------------------------------
Error: Only size_t of 4 bytes are supported. Read with (173)
Info : JTAG tap: esp32s3.tap0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.tap1 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.cpu0] Reset cause (3) - (Software core 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 : [esp32s3.cpu1] Reset cause (3) - (Software core reset)
Info : [esp32s3.cpu0] Reset cause (3) - (Software core reset)
Info : [esp32s3.cpu0] Target halted, PC=0x42000ADC, debug_reason=00000001
Info : Set GDB target to 'esp32s3.cpu0'
Info : [esp32s3.cpu1] Target halted, PC=0x40043A40, debug_reason=00000000
Error: RTOS: failed to get register list- The important point to note here is the
Warn : No symbols for ZephyrandError: RTOS: failed to get register listlogs.
I tried everything I could and knew based on my skillset, but I'm not sure what to do next or what to check
Guidance or help would be greatly appreciated!
Getting this to work would be the "cherry on top" for espressif support in Zephyr (not that you guys aren't already trying your hardest)
But RTOS-enabled debugging is HUGE for complex apps. There's a lot of people out there wanting to get this working :)
I hope I've outlined the issue as good as I could. I am very happy to collaborate and even implement fixes in this repo or the zephyr project.
I just have no idea what the problem seems to be, or where to start!
Debug Logs
Expected behavior
I would expect the Call stacks for all the threads to have the correct info, and call stacks.
I do NOT expect AMP or SMP support. I'm only using cpu0
One step at the time 💯
Screenshots
No response