I am trying to debug XIAO ESP32C3, and I face the Error: Failed to get flash maps (4294967295)!
My PC under Linux is connected directly to XIAO ESP32C3 via USB cable, I am not using any external JTAG adapter.
1/ I successfully upload my program to the target
I use default configuration for platformio.ini :
[env:seeed_xiao_esp32c3]
platform = espressif32
board = seeed_xiao_esp32c3
framework = arduino
2/ I do not succeed to start debugger, OpenOCD fails to get flash maps
Content of platformio.ini :
[env:seeed_xiao_esp32c3]
platform = espressif32
board = seeed_xiao_esp32c3
framework = arduino
debug_tool = custom
debug_server =
$PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/bin/openocd
-f
$PLATFORMIO_CORE_DIR/packages/tool-openocd-esp32/share/openocd/scripts/board/esp32c3-builtin.cfg
Reading symbols from /home/xxx/Documents/PlatformIO/Projects/ESP32-C3-LED/.pio/build/seeed_xiao_esp32c3/firmware.elfâŚ
PlatformIO Unified Debugger â Redirecting...
PlatformIO: debug_tool = custom
PlatformIO: Initializing remote targetâŚ
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
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
adapter speed: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : esp_usb_jtag: serial (D4:F9:8D:03:EF:80)
Info : esp_usb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
Info : clock speed 5000 kHz
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : datacount=2 progbufsize=16
Info : Examined RISC-V core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101104
Info : starting gdb server for esp32c3 on pipe
Info : accepting âgdbâ connection from pipe
Memory protection is enabled. Reset target to disable itâŚ
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : Reset cause (3) - (Software core reset)
Warn : No symbols for FreeRTOS!
Info : [esp32c3] Found 8 triggers
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
Error: Failed to get flash size!
Error: Failed to get flash size!
Error: Failed to probe flash, size 0 KB
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use âgdb_memory_map disableâ.
Error: attempted âgdbâ connection rejected
I see in the documentation: âSeeed Studio XIAO ESP32C3 does not have on-board debug probe and IS NOT READY for debugging. You will need to use/buy one of external probe listed below.â I am not sure to understand this information since ESP32C3 has on-board debugging facilities since v0.3.
I am using PlatformIO 6.1.9