Arm JTAG适配器ULINK-ME和openocd(在ArchLinux上)
我今天从官方的ArchLinux存储库安装了Openocd,现在正试图将它与我的JTAG适配器一起使用。我发现ULINK-ME使用CMSIS-DAP调试固件。Openocd有CMSIS-DAP驱动程序,因此应该能够与我的适配器通信,但在我编写下面的命令后,我出现了一个错误 我正在将ULINK-ME连接到集成微控制器LPC3141的板上,这是我加载配置文件的LPC3131的近亲Arm JTAG适配器ULINK-ME和openocd(在ArchLinux上),arm,archlinux,openocd,cmsis,Arm,Archlinux,Openocd,Cmsis,我今天从官方的ArchLinux存储库安装了Openocd,现在正试图将它与我的JTAG适配器一起使用。我发现ULINK-ME使用CMSIS-DAP调试固件。Openocd有CMSIS-DAP驱动程序,因此应该能够与我的适配器通信,但在我编写下面的命令后,我出现了一个错误 我正在将ULINK-ME连接到集成微控制器LPC3141的板上,这是我加载配置文件的LPC3131的近亲 sudo openocd -f /usr/local/share/openocd/scripts/interface/c
sudo openocd -f /usr/local/share/openocd/scripts/interface/cmsis-dap.cfg -f /usr/local/share/openocd/scripts/target/lpc3131.cfg -d3
Open On-Chip Debugger 0.8.0-dev-00175-g8b7acca-dirty (2014-10-14-19:53)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
User : 13 1 command.c:549 command_print(): debug_level: 3
Debug: 14 1 configuration.c:45 add_script_search_dir(): adding /root/.openocd
Debug: 15 1 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/site
Debug: 16 1 configuration.c:45 add_script_search_dir(): adding /usr/local/share/openocd/scripts
Debug: 17 1 configuration.c:86 find_file(): found /usr/local/share/openocd/scripts/interface/cmsis-dap.cfg
Debug: 18 1 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_interface cmsis-dap
Debug: 19 2 command.c:145 script_debug(): command - interface ocd_interface cmsis-dap
Debug: 21 2 command.c:369 register_command_handler(): registering 'ocd_cmsis-dap'...
Debug: 22 2 command.c:369 register_command_handler(): registering 'ocd_cmsis_dap_vid_pid'...
Debug: 23 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 24 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 25 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 26 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 27 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 28 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 29 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 30 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Debug: 31 2 command.c:369 register_command_handler(): registering 'ocd_jtag'...
Info : 32 2 transport.c:118 allow_transports(): only one transport option; autoselect 'cmsis-dap'
Debug: 33 2 adi_v5_cmsis_dap.c:246 cmsis_dap_select(): CMSIS-ADI: cmsis_dap_select
Debug: 34 2 command.c:404 register_command(): command 'cmsis-dap' is already registered in '<global>' context
Debug: 35 2 command.c:369 register_command_handler(): registering 'ocd_cmsis-dap'...
Error: 36 7 cmsis_dap_usb.c:175 cmsis_dap_usb_open(): unable to open CMSIS-DAP device
Error: 37 7 adi_v5_cmsis_dap.c:266 cmsis_dap_select(): unable to init CMSIS-DAP driver
Error: 38 7 transport.c:83 transport_select(): Error selecting 'cmsis-dap' as transport
Debug: 39 7 command.c:631 run_command(): Command failed with error code -4
User : 40 7 command.c:669 command_run_line(): Runtime Error: /usr/local/share/openocd/scripts/interface/cmsis-dap.cfg:7:
in procedure 'script'
at file "embedded:startup.tcl", line 58
in procedure 'interface' called at file "/usr/local/share/openocd/scripts/interface/cmsis-dap.cfg", line 7
因为里面没有字符串“CMSIS-DAP”,我想这意味着我有一个旧的ULINK-ME(在2013年之前购买)适配器,它没有CMSIS-DAP固件。我希望Keil能为我的老ULINK-ME提供一些闪烁CMSIS-DAP的方式
解决方案: 我写信给Keil,他们声称ULINK-ME的固件可以更新,这是真的。他们向我指出这三个环节: 我必须在Windows机器上安装MDK-ARMV5,然后单击工具栏上一个隐藏的图标(魔杖)。在调试中,我选择了ULINK2/ME选项,它自己更新了我的固件。现在我的ULINK-ME(旧款)上有一个CMSIS-DAP,我可以用
sudo lsusb-v
确认这一点:
Bus 005 Device 026: ID c251:2723 Keil Software, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0xc251 Keil Software, Inc.
idProduct 0x2723
bcdDevice 1.00
iManufacturer 1 Keil Software
iProduct 2 Keil ULINK-ME CMSIS-DAP
iSerial 3 M0489MAE
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 4 CMSIS-DAP
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 33
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
我试着用葡萄酒来做这件事,但不可能。至少现在我不再需要Windows了
0.8.0-dev-00175-g8b7acca-dirty
这看起来不像官方的OpenOCD。你从哪儿弄来的
注意:您的版本应该是0.9.0
,而绝对不是“脏的”
您的OpenOCD版本可能存在CMSIS-DAP问题。
我强烈建议您从此处克隆当前头部:
git clone git://git.code.sf.net/p/openocd/code openocd
(请记住在克隆后进行/configure…
之前执行/bootstrap
)
-或者在Windows下运行时从下载
sudo openocd
这里也有问题。您不应该在每次使用OpenOCD时都使用“sudo”
无论如何,您应该能够使用JTAG(LPC3141似乎太旧,无法支持SWD)。这是一个问题,因为我必须使用Archlinux官方存储库安装openocd。Archlinux官方存储库可能已经过时了。“官员们”经常选择一个版本,这个版本有问题(出于某种原因)。如果你有可能自己建造它,我很乐意指导你完成它。但由于重建需要一些时间,你可能想先尝试使用社会福利署;这应该相当简单。这是没有意义的,因为我的JTAG适配器没有CMSIS-DAP固件。:)我给自己买了一个更好的JTAG适配器(J-link EDU)。Arch存储库中的OpenOCD要么是香草0.8.0,要么你可以自己构建一个(使用当前的git头),当你使用来自AUR的包时……我知道,但相信我,官方包是干净的0.8.0,在AUR中,你可以从git构建任何你想要的东西。。。例如,几天前我使用AUR中的包构建了一个二进制文件-
Open-On-Chip Debugger 0.9.0-dev-00186-g30203b3(2014-11-07-11:55)
。
Bus 005 Device 026: ID c251:2723 Keil Software, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0xc251 Keil Software, Inc.
idProduct 0x2723
bcdDevice 1.00
iManufacturer 1 Keil Software
iProduct 2 Keil ULINK-ME CMSIS-DAP
iSerial 3 M0489MAE
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 4 CMSIS-DAP
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.00
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 33
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
git clone git://git.code.sf.net/p/openocd/code openocd