Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Fix: CMSIS-DAP HID I/O#2103

Merged
esden merged 18 commits intomainfrom
fix/cmsis-dap-hid-io
Apr 3, 2025
Merged

Fix: CMSIS-DAP HID I/O#2103
esden merged 18 commits intomainfrom
fix/cmsis-dap-hid-io

Conversation

@dragonmux
Copy link
Copy Markdown
Member

Detailed description

In this PR we address several issues encountered with certain CMSIS-DAP adaptors, notably ones from Atmel such as the JTAGICE3 which use HID (CMSIS-DAP v1.0.0, the unpublished spec) and massive packets (512 bytes) over HS.

We aim with this to fix the transfer behaviour for these adaptors (the packets are one byte too short before this, causing problems with the communication cycle), and provide various fallbacks and such for commands not implemented in the older versions of the spec.

The over-all result should be a more stable CMSIS-DAP experience and saner behaviour out of HID based adaptors.

Your checklist for this pull request

Closing issues

dragonmux and others added 18 commits April 3, 2025 01:26
…, allowing much more correct retries and failure handling
…ong `dap_packet_size` calculated for adaptors with a 512 byte HID report length
…o `FT_Write()` (the function is not const-correct)
…er to `perform_dap_transfer_swd_unchecked()`
…ver to `perform_dap_transfer_swd_unchecked()`
…s to return from the HID I/O calls and how many to copy into the output buffer
When a transaction is split (due to having the final TMS bit high), the
value that is returned needs to be ORed into the final byte, rather than
simply overwriting it. This enables the full upper byte to be reported to
the caller.

Signed-off-by: Sean Cross <sean@xobs.io>
@dragonmux dragonmux added Bug Confirmed bug BMD App Black Magic Debug App (aka. PC hosted) (not firmware) labels Apr 3, 2025
@dragonmux dragonmux added this to the v2.0 release milestone Apr 3, 2025
@dragonmux dragonmux requested a review from esden April 3, 2025 00:46
@dragonmux dragonmux changed the title Fix/cmsis dap hid io Fix: CMSIS-DAP HID I/O Apr 3, 2025
Copy link
Copy Markdown
Member

@esden esden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@esden esden merged commit 8ce7aab into main Apr 3, 2025
17 of 36 checks passed
@dragonmux dragonmux deleted the fix/cmsis-dap-hid-io branch April 3, 2025 00:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

BMD App Black Magic Debug App (aka. PC hosted) (not firmware) Bug Confirmed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants