Skip to content

probe: cmsis-dap: skip zero-length USB IN packets - #2061

Open
RobertRostohar wants to merge 2 commits into
pyocd:developfrom
RobertRostohar:dap2_usb_in_zlp
Open

RobertRostohar wants to merge 2 commits into
pyocd:developfrom
RobertRostohar:dap2_usb_in_zlp

Conversation

@RobertRostohar

Copy link
Copy Markdown
Collaborator

Some CMSIS-DAP v2 probes append a ZLP after a full-size response, causing it to be interpreted as the next command's response.

Some CMSIS-DAP v2 probes append a ZLP after a full-size response,
causing it to be interpreted as the next command's response.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change preserves response ordering, token accounting, shutdown handling, and existing error propagation.

No open issues 🎉

What changed in this PR

Fixes CMSIS-DAP v2 response handling so trailing zero-length USB packets are not mistaken for command responses.

Changes:

  • Retries empty reads without consuming another read token, while preserving shutdown checks.
  • Removes an unused import and reformats the SWO read call.
File Description
pyocd/​probe/​pydapaccess/​interface/​pyusb_v2_backend.py Skips empty USB responses and cleans up surrounding code.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

3 participants