esp32-debug

.vscode/launch.json配置文件

example

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "espidf",
      "name": "Launch",
      "request": "launch",
      "debugPort": 9998,
      "logLevel": 2,
      "mode": "manual",
      "verifyAppBinBeforeDebug": false,
      "tmoScaleFactor": 1,
      "initGdbCommands": [
        "target remote :3333",
        "symbol-file /path/to/program.elf",
        "mon reset halt",
        "flushregs",
        "thb app_main"
      ],
      "env": {
        "CUSTOM_ENV_VAR": "SOME_VALUE"
      }
    }
  ]
}
  1. type:只能是espidf;
  2. name:调试名称,不重要
  3. request
  4. debugPort:调试器的端口,默认43474
  5. logLevel:日志级别,默认为2
    1. mode参数为automanualauto自动启动openOCD服务器,manual手动启动
  6. verifyAppBinBeforeDebug:默认为false,调试只能调用工程下的可执行文件,改为ture,可以手动指定可执行文件
  7. tmoScaleFactor:超时时间
  8. initGdbCommands
  9. env:设置环境变量