Skip to content

usb_cdc: export receive window for host flow control#7265

Open
Argolein wants to merge 1 commit into
Klipper3d:masterfrom
Argolein:usb-fix-pr
Open

usb_cdc: export receive window for host flow control#7265
Argolein wants to merge 1 commit into
Klipper3d:masterfrom
Argolein:usb-fix-pr

Conversation

@Argolein

@Argolein Argolein commented May 9, 2026

Copy link
Copy Markdown

This PR matches the behavior already used by the UART and CAN serial transports, which expose their MCU-side receive window to the host so that Klipper can throttle outstanding command data appropriately.

Hardware / Reproduction Setup

This was tested on:

  • Duet3D Mini 5+ with SAME54P20A
  • USB CDC connection to the Klipper host
  • Raspberry Pi 4B running Klipper / Moonraker
  • EBB36 Tool Board connected with USB as well

Issue I had:

During normal prints, the main MCU connection would sporadically enter phases where bytes_retransmit increased rapidly and eventually caused a shutdown. bytes_invalid stayed at zero, and the EBB connection did not show the same behavior.

After fix applied:

After exporting RECEIVE_WINDOW for USB CDC, the same print workload passed the previous retransmit escalation window without the main MCU retry counter rising.

@Argolein

Argolein commented May 9, 2026

Copy link
Copy Markdown
Author

-deleted not relevant-

@github-actions

Copy link
Copy Markdown

Thank you for your contribution to Klipper. Unfortunately, a reviewer has not assigned themselves to this GitHub Pull Request. All Pull Requests are reviewed before merging, and a reviewer will need to volunteer. Further information is available at: https://www.klipper3d.org/CONTRIBUTING.html

There are some steps that you can take now:

  1. Perform a self-review of your Pull Request by following the steps at: https://www.klipper3d.org/CONTRIBUTING.html#what-to-expect-in-a-review
    If you have completed a self-review, be sure to state the results of that self-review explicitly in the Pull Request comments. A reviewer is more likely to participate if the bulk of a review has already been completed.
  2. Consider opening a topic on the Klipper Discourse server to discuss this work. The Discourse server is a good place to discuss development ideas and to engage users interested in testing. Reviewers are more likely to prioritize Pull Requests with an active community of users.
  3. Consider helping out reviewers by reviewing other Klipper Pull Requests. Taking the time to perform a careful and detailed review of others work is appreciated. Regular contributors are more likely to prioritize the contributions of other regular contributors.

Unfortunately, if a reviewer does not assign themselves to this GitHub Pull Request then it will be automatically closed. If this happens, then it is a good idea to move further discussion to the Klipper Discourse server. Reviewers can reach out on that forum to let you know if they are interested and when they are available.

Best regards,
~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant