Some cmsis-dap-v1 devices has an usb serial and CMSIS DAP
in it's name.
Seems openocd choose to workaroud bug for KitProg3
by search CMSIS DAP
in all usb devices, and not only WinUSB, but it also broken supported for all cmsis-dap-v1(hid) devices with an usb serial and CMSIS DAP
in the name of serial(it will use cmsis-dap-v2 and failed)
https://github.com/openocd-org/openocd/blob/v0.12.0-rc1/src/jtag/drivers/cmsis_dap_usb_bulk.c#L249-L273
One workaround is make a copy of cmsis-dap.cfg
, add cmsis_dap_backend hid
to the new file and use the new one. But maybe it should works out of box by add an separately cmsis-dap-v1.cfg
, do auto fallback to v1, use whitelist for special error devices, or use blacklist for usb serial with CMSIS DAP
in name.
https://github.com/openocd-org/openocd/blob/v0.12.0-rc1/src/jtag/drivers/cmsis_dap_usb_bulk.c#L340-L342
Not sure, but should it also return FAIL here to make an fallback like all other place does?
Many error report can be found on the web.
https://www.google.com/search?q=Warn+%3A+Using+CMSIS-DAPv2+interface+1+with+wrong+class+10+subclass+0+or+protocol+0
https://github.com/search?q=cmsis_dap_backend+hid&type=issues
Updated:
https://github.com/openocd-org/openocd/blob/v0.12.0-rc1/src/jtag/drivers/cmsis_dap_usb_bulk.c#L340-L342
Not sure, but should it also return ERROR_FAIL here, or contine for next
for
loop, to make an fallback like all other place does?If CMSIS-DAP is included in the interface string of CDC ACM it is the peak of ignorance from the vendor - serial interface has nothing common with CMSIS-DAP protocol.
OpenOCD does not care about WinUSB descriptors as it runs on open systems too. Also CMSIS-DAP specs does not mention anything about WinUSB.
The autodetection is based on the principle that it is better to find at least something as user can easily force fallback by adding
In the case the search for v2 interface fails the workaround is more complicated as you have to find the interface number and use
If you want please submit such change to https://review.openocd.org
The easy improvement could be limiting CMSIS-DAP bulk interface detection to uncommon classes only and filter out mainly CDC and MSC classes. Let's hope no vendor missconfigures bulk if as it were serial...
Please test
https://review.openocd.org/c/openocd/+/7279
I'm afraid that this issue could happen again in future with other adapters.
If you have a linux machine, can you please plug the KitProg3 and post here the output of "lsusb -v -d 04b4:"?
This could help keeping a log of problematic devices and take care of them if further fixes has to be applied.
Maybe all such lsusb logs could be added as independent text files in OpenOCD code
Sorry for the delay, I lost the device for some time and finally found it.
I tried https://review.openocd.org/c/openocd/+/7279 and it works for the device
lsusb -v for the device(the one with
CMSIS-DAP
in name of CDC, and NOT KitProg3)Thanks for the log and for testing https://review.openocd.org/c/openocd/+/7279
This adapter reuses Keil vendor ID...