: Flash mapping 0: 0x10020 -> 0x3c020020, 27 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 75 KB
Info : Auto-detected flash bank 'esp32c3.flash' size 4096 KB
Info : Using flash bank 'esp32c3.flash' size 4096 KB
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 27 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 75 KB
Info : Using flash bank 'esp32c3.irom' size 76 KB
Info : Flash mapping 0: 0x10020 -> 0x3c020020, 27 KB
Info : Flash mapping 1: 0x20020 -> 0x42000020, 75 KB
Info : Using flash bank 'esp32c3.drom' size 28 KB
Warn : negative reply, retrying
Warn : Prefer GDB command "target extended-remote :3333" instead of "target remote :3333"
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg: 0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
Info : Reset cause (3) - (Software core reset)
VSCode
使用指令行已成功,接下来使用VSCode
VSCode ESP-IDF插件官方说明如下,我使用ESP-IDF Debug Adapter失败,使用Microsoft C/C++ extension调试成功
vscode-esp-idf-extension/DEBUGGING.md at master · espressif/vscode-esp-idf-extension · GitHub
使用ESP-IDF插件,启动OpenOCD,打印如下,本质和指令行直接调用没啥区别
[OpenOCD]
[Stopped] : OpenOCD Server
[OpenOCD]
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
[OpenOCD]
debug_level: 2
[OpenOCD]
Info : only one transport option; autoselect 'jtag'
[OpenOCD]
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
[OpenOCD]
Info : Listening on port 6666 for tcl connections
[OpenOCD]
Info : Listening on port 4444 for telnet connections
[OpenOCD]
Info : esp_usb_jtag: serial (60:55:F9:75:9C:90)
[OpenOCD]
Info : esp_u[OpenOCD]
sb_jtag: Device found. Base speed 40000KHz, div range 1 to 255
[OpenOCD]
Info : cloc[OpenOCD]
k speed 40000 kHz
[OpenOCD]
Info : JTAG tap: esp32c3.cpu tap/device found: 0x00005c25 (mfg:[OpenOCD]
0x612 (Espressif Systems), part: 0x0005, ver: 0x0)
[OpenOCD]
Info : datacount=2 progbufsize=16
[OpenOCD]
Info : Examined RISC-V[OpenOCD]
core; found 1 harts
Info : hart 0: XLEN=32, misa=0x40101104
[OpenOCD]
Info : [esp32c3] Found 8 trig[OpenOCD]
gers
[OpenOCD]
Info : starting gdb server for esp32c3 on 3333
Info : Listening on port 3333 for gdb connections
根据插件官方说明,创建launch.json,我修改了"miDebuggerPath",根据自己的情况修改即可
{
"version": "0.2.0",
"configurations": [
{
"name": "GDB",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerPath": "F:/Espressif/tools/riscv32-esp-elf/esp-2021r2-patch5-8.4.0/riscv32-esp-elf/bin/riscv32-esp-elf-gdb.exe",
"program": "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
"windows": {
"program": "${workspaceFolder}\\build\\${command:espIdf.getProjectName}.elf"
},
"cwd": "${workspaceFolder}",
"environment": [{ "name": "PATH", "value": "${config:idf.customExtraPaths}" }],
"setupCommands": [
{ "text": "target remote :3333" },
{ "text": &quo