先安装 espressif idf插件
设置插件
主要是修改
{
"C_Cpp.intelliSenseEngine": "Tag Parser",
"idf.adapterTargetName": "esp32s3",
"idf.openOcdConfigs": [
"board/esp32s3-builtin.cfg"
],
"idf.portWin": "COM42",
"idf.flashType": "JTAG",
"idf.listDfuDevices": [
],
"files.associations": {
"freertos.h": "c",
"sdkconfig.h": "c",
"esp_spi_flash.h": "c",
"esp_system.h": "c",
"esp_attr.h": "c",
"esp_log.h": "c",
"soc_memory_types.h": "c",
"crosscore_int.h": "c",
"startup_internal.h": "c"
},
"idf.flashBaudRate": "460800",
"idf.launchMonitorOnDebugSession": false,
"idf.openOcdLaunchArgs": [
],
"openocd.tcl.port": 3333
}
修改对应的端口我的是com42
还有一个文件修改
{
"version": "0.2.0",
"configurations": [
{
"name": "GDB",
"type": "cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerPath": "${command:espIdf.getXtensaGdb}",
"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": "set remotetimeout 100" },
{ "text": "target extended-remote :3333" },
{ "text": "set remote hardware-watchpoint-limit 2"},
{ "text": "mon reset halt" },
{ "text": "thb app_main" },
{ "text": "flushregs" }
],
"externalConsole": false,
"logging": {
"engineLogging": true
}
}
]
}
开始调试---先按F1
开启openocd
输出对应的信息
按F5进入调试模式 需要多启动几次