I compiled openocd from git (latest commit: March 7, 2021) with --enable-cmsis-dap
.
openocd cannot open my CMSIS-DAP device:
openocd -f interface/cmsis-dap.cfg -f target/max32660.cfg
Open On-Chip Debugger 0.11.0+dev-00056-g6448f70-dirty (2021-03-20-23:58)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: unable to find a matching CMSIS-DAP device
Warn : Flash driver of max32xxx.flash does not support free_driver_priv()
USB setup is fine. See, pyocd
finds the CMSIS-DAP just fine:
pyocd cmd --target MAX32660
Connected to MAX32660 [Running]: 044400006fed0cc900000000000000000000000097969904
>>>
So how can openocd
not find it?
Also, openocd
used to be able to find it. How can it change its mind?
Here is more debug output around openocd
's interaction with the CMSIS-DAP device:
Debug: 108 14 cmsis_dap_usb_bulk.c:177 cmsis_dap_usb_open(): enumerating interfaces of 0x10c4:0xea60
Debug: 109 15 cmsis_dap_usb_bulk.c:157 cmsis_dap_usb_open(): found product string of 0x0d28:0x0204 'DAPLink CMSIS-DAP'
Debug: 110 15 cmsis_dap_usb_bulk.c:177 cmsis_dap_usb_open(): enumerating interfaces of 0x0d28:0x0204
Debug: 111 15 cmsis_dap_usb_bulk.c:244 cmsis_dap_usb_open(): skipping interface 0, endpoint[0] is not bulk out
Debug: 112 16 cmsis_dap_usb_bulk.c:224 cmsis_dap_usb_open(): found interface 3 string 'CMSIS-DAP'
Debug: 113 16 cmsis_dap_usb_bulk.c:244 cmsis_dap_usb_open(): skipping interface 3, endpoint[0] is not bulk out
Debug: 114 16 cmsis_dap_usb_bulk.c:237 cmsis_dap_usb_open(): skipping interface 1, has only 1 endpoints
Debug: 115 16 cmsis_dap_usb_bulk.c:285 cmsis_dap_usb_open(): skipping interface 2, class 10 subclass 0 protocol 0
Looks to me like it "found" the device? So what is the problem then?
Update: If I unplug and replug the CMSIS-DAP, then it works. But it seems that after running a few commands in pyocd
(which generally works better than openocd
) then openocd
has this problem again. So, kind of a workaround, but painful.