乐鑫技术交流
直播中

新疆切糕

13年用户 1266经验值
私信 关注
[问答]

使用jlink与ESP32S2-SAOLA连接,vscode下使用jtag下载失败的原因?如何解决?

# 问题描述
使用jlink 与ESP32S2-SAOLA连接,能进入在线调试,但点击flash的时候,弹出如下提示:
Open On-Chip Debugger  v0.10.0-esp32-20210401 (2021-04-01-15:46)

Licensed under GNU GPL v2

For bug reports, read

        http://openocd.org/doc/doxygen/bugs.html

debug_level: 2




adapter speed: 9600 kHz

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : J-Link V9 compiled Dec 13 2019 11:14:50

Info : Hardware version: 9.40

Info : VTarget = 3.311 V

Info : clock speed 9600 kHz

Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)

Info : esp32s2: Target halted, PC=0x4001ABA8, debug_reason=00000004

Info : Detected ESP32-S2 chip

Info : Listening on port 3333 for gdb connections

Info : accepting 'tcl' connection on tcp/6666

Info : dropped 'tcl' connection


launch.json 文件设置如下:
// ======================== launch.json ========================

{

  // Use IntelliSense to learn about possible attributes.

  // Hover to view descriptions of existing attributes.

  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

  "version": "0.2.0",

  "configurations": [

    {

      "type": "espidf",

      "request": "launch",

      "name": "Debug ESP32",

      "target": "build/${workspaceFolderBasename}.elf",

      "cwd": "${workspaceFolder}",

      "gdbpath": "${config:idf.toolsPathWin}/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe", // Path of the toolchain

      "autorun": [

        "target remote :3333", // Connect to OpenOCD

        "mon reset halt", // Reset the chip and keep the CPUs halted

        "set remote hardware-watchpoint-limit 2", // Restrict GDB to using two hardware watchpoints supported by ESP32

        "flushregs", // Force GDB to get new state from the target

        "thb app_main", // Insert a temporary hardware breakpoint at the main function

        "c" // Resume the program. It will then stop at breakpoint inserted at app_main

      ],

      // "preLaunchTask": "OpenOCD"

    },

    {

      "type": "espidf",

      "request": "launch",

      "name": "flash and debug ESP32",

      "target": "build/${workspaceFolderBasename}.elf",

      "cwd": "${workspaceFolder}",

      "gdbpath": "${config:idf.toolsPathWin}/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gdb.exe", // Path of the toolchain

      "autorun": [

        "target remote :3333", // Connect to OpenOCD

        "mon reset halt", // Reset the chip and keep the CPUs halted

        "mon program_esp32 build/${workspaceFolderBasename}.bin 0x10000",

        "mon reset halt", // Reset the chip and keep the CPUs halted

        "set remote hardware-watchpoint-limit 2", // Restrict GDB to using two hardware watchpoints supported by ESP32

        "flushregs", // Force GDB to get new state from the target

        "thb app_main", // Insert a temporary hardware breakpoint at the main function

        "c" // Resume the program. It will then stop at breakpoint inserted at app_main

      ],

      // "preLaunchTask": "OpenOCD"

    }



  ],

  "idf.adapterTargetName": "esp32s2"

}


settings.json设置如下:


{

  "idf.adapterTargetName": "esp32s2",

  "idf.openOcdConfigs": [

      "interface/jlink.cfg",

      "target/esp32s2.cfg"

  ],

  "idf.portWin": "COM6",

  "idf.flashType":"JTAG"

}


感谢各位大佬回复。

更多回帖

发帖
×
20
完善资料,
赚取积分