Skip to content

Fix CMSIS-DAP packet sizes for Atmel programmers - #699

Open
aWZHY0yQH81uOYvH wants to merge 1 commit into
trabucayre:masterfrom
aWZHY0yQH81uOYvH:fix-atmel-cmsisdap
Open

Fix CMSIS-DAP packet sizes for Atmel programmers#699
aWZHY0yQH81uOYvH wants to merge 1 commit into
trabucayre:masterfrom
aWZHY0yQH81uOYvH:fix-atmel-cmsisdap

Conversation

@aWZHY0yQH81uOYvH

@aWZHY0yQH81uOYvH aWZHY0yQH81uOYvH commented Aug 1, 2026

Copy link
Copy Markdown

The CMSIS-DAP backend does not work with certain Atmel/Microchip debuggers (constant timeouts, responses for earlier queries being returned for later ones).

% openFPGALoader --fpga-part xc7k480tffg1156 --cable cmsisdap --vid 0x03EB --pid 0x2141 --detect -vvv
Cable VID overridden
Cable PID overridden
cmsisDAP: failed to find compatible CMSIS-DAP v2 device
cmsisDAP v2: try USB bulk init but failed
Found 1 compatible device:
    0x03eb 0x2141 0x0 Atmel-ICE CMSIS-DAP
Error: HID read timeout

    VID: 03eb
Error: HID read timeout

    PID: 2141
Error: HID read timeout

    serial number: J427000xxxxx
Error: HID read timeout

    firmware version : NA
Error: HID read timeout

    target device vendor: Atmel Corp.
Error: HID read timeout

    target device name: Atmel-ICE CMSIS-DAP
Error: HID read timeout

    hardware capabilities : NA
Error: HID read timeout

    SWO trace buffer size : NA
Error: Waiting for 1Byte received 20
00 14 41 74 6d 65 6c 2d 49 43 45 20 43 4d 53 49 53 2d 44 41 50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
Error: HID read timeout

    max packet size : NA
Error: HID read timeout

Hardware cap f0 00 00
JTAG is not supported by the probe

Apparently, some Atmel tools use a nonstandard report size, which wreaks all kinds of havoc on the CMSIS-DAP backend. OpenOCD handles this with a table of offending VID/PIDs, allowing the initial communication to proceed correctly even before packet sizes can be queried. This fix simply sets _pkt_sz in advance if the user specifies any of the known VID/PID pairs.

This now allows my Atmel-ICE debugger to work with openFPGALoader.

AI disclosure: Claude found this and wrote the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant