cmsis_dap_usb_hid: improve detection of probes with unusual report sizes
commit3413ae67ae4b886f240c57af8bf562fb0ba8ce76
authorSamuel Dewan <samdewan@me.com>
Fri, 1 Dec 2023 19:16:22 +0000 (1 14:16 -0500)
committerTomas Vanek <vanekt@fbl.cz>
Fri, 15 Dec 2023 05:56:35 +0000 (15 05:56 +0000)
tree5d8cd0929be3f2f3f63e508ed277ee232f11c999
parentc1ae95f6f55168a15a7cf359c1d4c5f1d4b04c01
cmsis_dap_usb_hid: improve detection of probes with unusual report sizes

Currently all Atmel CMSIS-DAP interfaces are assumed to have 512 byte
reports except for the mEDBG (found on Xplained Mini boards) and the nEDBG
(found on Curiosity Nano boards). This check is far from exaustive and it
results in some Microchip programmers (like the MPLAB Snap and PICkit 4)
not working correctly with OpenOCD.

Instead of assuming that Atmel programmers have 512 byte reports unless we
know otherwise, this commit flips the logic around. Only the older "third
generation" EDBG based programmers have 512 byte report sizes, and that 64
bytes will be more common in Microchip tools going forward.

The list of PIDs for 3rd generation Microchip programmers comes from
toolinfo.py from Microchip's pyedbglib.

This commit adds a more generic "quirks" list that will allow programmers
with unusual report sizes to be added easily in the future.

Change-Id: Ic39a4bdcd67c4c93d5707657c6ee5d216bc4437a
Signed-off-by: Samuel Dewan <samdewan@me.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8033
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/jtag/drivers/cmsis_dap_usb_hid.c