无法在 Mac 上安装和配置 J-Link JTAG 调试器
Unable to install and configure a J-Link JTAG debugger on a Mac
我有一个 Segger J-Link,我想在 Macbook 运行ning MacOS Catalina 10.15.4 上使用它,使用 openocd 和 GDB 针对 ESP32 开发板。问题是我看不到设备:
$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.JimsiPhone-WirelessiAP /dev/cu.SLAB_USBtoUART /dev/cu.usbserial-0001
None 其中是 J-Link。如果我 运行 lsusb 我可以看到它:
$ lsusb
Bus 020 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 020 Device 003: ID 1366:0101 SEGGER J-Link ARM
我已经安装了从 Segger 下载的 "J-Link Software and Documentation Pack"。我已经检查了 Mac "Security and privacy" 设置,它没有报告它阻止安装任何驱动程序或程序或 运行.
在 J-Link 上,绿色 LED 亮起,每秒闪烁两次。
我确定我少了一块,非常感谢您的帮助。
更新:我一直在按照此处的说明进行操作:
在我进入第 6 步之前一切正常,我按照以下说明操作:
问题是,驱动程序的路径从未出现,正如我上面所描述的。如果我不能让它与我的 J-link.
对话,我认为我无法 运行 OpenOCD
当我 运行 openocd-esp32 时,我得到(来自 openocd-esp32 输出的完整粘贴如下):
Error: No J-Link device found.
esp32-wroom-32.cfg的内容是:
echo "WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release."
set ESP32_FLASH_VOLTAGE 3.3
source [find target/esp32.cfg]
这是完整的粘贴:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Error: No J-Link device found.
** OpenOCD init failed **
shutdown command invoked
Assertion failed: (jtag_trst == 0), function jtag_checks, file src/jtag/core.c, line 343.
Abort trap: 6
运行 JLinkExe 确实找到了 J-Link:
Jims-MacBook-Pro-486:~ jim$ JLinkExe
SEGGER J-Link Commander V6.80b (Compiled Jun 5 2020 17:42:04)
DLL version V6.80b, compiled Jun 5 2020 17:41:46
Connecting to J-Link via USB...Updating firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Replacing firmware: J-Link V11 compiled Aug 14 2019 16:21:09
Waiting for new firmware to boot
New firmware booted successfully
O.K.
Firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Hardware version: V11.00
S/N: 51000936
License(s): GDB
VTref=0.000V
Type "connect" to establish a target connection, '?' for help
J-Link>
完成上述操作后,我现在在 运行ning openocd-esp32 时收到不同的错误消息(可能是因为 J-Link FW 升级?)。最初它抱怨没有设置适配器速度,所以我修改了 interface/jlink.cfg 并添加:
adapter_khz 3000
我现在得到一个不同的错误:
Error: JTAG scan chain interrogation failed: all ones
我一直在谷歌搜索,这可能意味着电路板损坏或另一个配置问题。虽然ESP32-WROVER-32U上面有SPI flash,但是SD卡槽里没有SD卡,板子上也没有其他SPI设备。
这里是 openocd-esp32 的完整输出:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 3000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 0.000 V
Info : clock speed 3000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Error: esp32_soc_reset: Couldn't halt target before SoC reset
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 75
at file "embedded:startup.tcl", line 449
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of esp32.irom does not support free_driver_priv()
Warn : Flash driver of esp32.drom does not support free_driver_priv()
成功!该电路使用了 Segger 10 针针连接器。在该连接器引脚 1 上是 VTREF,而在我的电路板上,它应该连接到 V3.3 时悬空。我连接它并且:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp32-wrover.cfg
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
WARNING: boards/esp32-wrover.cfg is deprecated, and may be removed in a future release.
If your board is ESP32-WROVER-KIT, use board/esp32-wrover-kit-1.8v.cfg instead.
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 3.290 V
Info : clock speed 1000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset.
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Listening on port 3333 for gdb connections
我建议逐步验证您的设置 - 我个人不喜欢大爆炸式集成。
- 验证您的 Segger 软件是否可以看到您的 JLink 探针 - 好消息是
lsusb
可以看到它。 JLink Commander 应该会提供一些有用的信息。
- 在没有任何可执行文件相关参数的情况下启动 openocd:
openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg
- 验证基本命令是否正常工作,即重置 CPU、显示寄存器、reading/writing 内存。
- 如果您仍在试验问题,请仔细检查您的接线 - 有关详细信息,请参阅 here。
我有一个 Segger J-Link,我想在 Macbook 运行ning MacOS Catalina 10.15.4 上使用它,使用 openocd 和 GDB 针对 ESP32 开发板。问题是我看不到设备:
$ ls /dev/cu.*
/dev/cu.Bluetooth-Incoming-Port /dev/cu.JimsiPhone-WirelessiAP /dev/cu.SLAB_USBtoUART /dev/cu.usbserial-0001
None 其中是 J-Link。如果我 运行 lsusb 我可以看到它:
$ lsusb
Bus 020 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light
Bus 020 Device 003: ID 1366:0101 SEGGER J-Link ARM
我已经安装了从 Segger 下载的 "J-Link Software and Documentation Pack"。我已经检查了 Mac "Security and privacy" 设置,它没有报告它阻止安装任何驱动程序或程序或 运行.
在 J-Link 上,绿色 LED 亮起,每秒闪烁两次。
我确定我少了一块,非常感谢您的帮助。
更新:我一直在按照此处的说明进行操作:
在我进入第 6 步之前一切正常,我按照以下说明操作:
问题是,驱动程序的路径从未出现,正如我上面所描述的。如果我不能让它与我的 J-link.
对话,我认为我无法 运行 OpenOCD当我 运行 openocd-esp32 时,我得到(来自 openocd-esp32 输出的完整粘贴如下):
Error: No J-Link device found.
esp32-wroom-32.cfg的内容是:
echo "WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release."
set ESP32_FLASH_VOLTAGE 3.3
source [find target/esp32.cfg]
这是完整的粘贴:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Error: No J-Link device found.
** OpenOCD init failed **
shutdown command invoked
Assertion failed: (jtag_trst == 0), function jtag_checks, file src/jtag/core.c, line 343.
Abort trap: 6
运行 JLinkExe 确实找到了 J-Link:
Jims-MacBook-Pro-486:~ jim$ JLinkExe
SEGGER J-Link Commander V6.80b (Compiled Jun 5 2020 17:42:04)
DLL version V6.80b, compiled Jun 5 2020 17:41:46
Connecting to J-Link via USB...Updating firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Replacing firmware: J-Link V11 compiled Aug 14 2019 16:21:09
Waiting for new firmware to boot
New firmware booted successfully
O.K.
Firmware: J-Link V11 compiled Apr 23 2020 16:49:23
Hardware version: V11.00
S/N: 51000936
License(s): GDB
VTref=0.000V
Type "connect" to establish a target connection, '?' for help
J-Link>
完成上述操作后,我现在在 运行ning openocd-esp32 时收到不同的错误消息(可能是因为 J-Link FW 升级?)。最初它抱怨没有设置适配器速度,所以我修改了 interface/jlink.cfg 并添加:
adapter_khz 3000
我现在得到一个不同的错误:
Error: JTAG scan chain interrogation failed: all ones
我一直在谷歌搜索,这可能意味着电路板损坏或另一个配置问题。虽然ESP32-WROVER-32U上面有SPI flash,但是SD卡槽里没有SD卡,板子上也没有其他SPI设备。
这里是 openocd-esp32 的完整输出:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg -c "program_esp32 build/hello-world.bin 0x10000 verify exit"
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 3000 kHz
WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
Info : Configured 2 cores
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 0.000 V
Info : clock speed 3000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Listening on port 3333 for gdb connections
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: esp32.cpu0: IR capture error; saw 0x1f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : cpu0: Debug controller 0 was reset.
Info : cpu0: Core 0 was reset.
Error: esp32_soc_reset: Couldn't halt target before SoC reset
embedded:startup.tcl:449: Error: ** Unable to reset target **
in procedure 'program_esp32'
in procedure 'program_esp' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 64
in procedure 'program_error' called at file "/Users/jim/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 75
at file "embedded:startup.tcl", line 449
Warn : Flash driver of esp32.flash does not support free_driver_priv()
Warn : Flash driver of esp32.irom does not support free_driver_priv()
Warn : Flash driver of esp32.drom does not support free_driver_priv()
成功!该电路使用了 Segger 10 针针连接器。在该连接器引脚 1 上是 VTREF,而在我的电路板上,它应该连接到 V3.3 时悬空。我连接它并且:
Jims-MacBook-Pro-486:~ jim$ openocd -f interface/jlink.cfg -f board/esp32-wrover.cfg
Open On-Chip Debugger v0.10.0-esp32-20200420 (2020-04-20-16:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 1000 kHz
WARNING: boards/esp32-wrover.cfg is deprecated, and may be removed in a future release.
If your board is ESP32-WROVER-KIT, use board/esp32-wrover-kit-1.8v.cfg instead.
Info : Configured 2 cores
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : J-Link V11 compiled Apr 23 2020 16:49:23
Info : Hardware version: 11.00
Info : VTarget = 3.290 V
Info : clock speed 1000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32: Debug controller 0 was reset.
Info : esp32: Core 0 was reset.
Info : esp32: Debug controller 1 was reset.
Info : esp32: Core 1 was reset.
Info : Listening on port 3333 for gdb connections
我建议逐步验证您的设置 - 我个人不喜欢大爆炸式集成。
- 验证您的 Segger 软件是否可以看到您的 JLink 探针 - 好消息是
lsusb
可以看到它。 JLink Commander 应该会提供一些有用的信息。 - 在没有任何可执行文件相关参数的情况下启动 openocd:
openocd -f interface/jlink.cfg -f board/esp-wroom-32.cfg
- 验证基本命令是否正常工作,即重置 CPU、显示寄存器、reading/writing 内存。
- 如果您仍在试验问题,请仔细检查您的接线 - 有关详细信息,请参阅 here。