Skip to content

Sync Klipper#7143: stm32: USB double buffering transmit - #1005

Merged
rogerlz merged 4 commits into
mainfrom
klipper-pr-7143
Oct 5, 2026
Merged

rogerlz merged 4 commits into
mainfrom
klipper-pr-7143

Conversation

@rogerlz

@rogerlz rogerlz commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Cherry-picks upstream USB double buffering transmit for stm32, keeping original authorship:

The AT32F403 special case in usbfs.c is kept. Tested on a Trident with an Octopus Pro H723 (usbotg) and an EBB36 G0B1 (usbfs): 10s of ADXL345 capture at ~3150Hz with no gaps and no USB retransmits, homing and moves.

KevinOConnor and others added 4 commits October 5, 2026 10:29
It is possible for USB host controllers to send back-to-back IN tokens
which only gives the MCU ~3us to queue the next USB packet in the
hardware.  That can be difficult to do if the MCU has to wake up the
task code.  The stm32 "usbotg" hardware does not support a builtin
generic double buffering transmit capability, but it is possible to
load the next packet directly from the irq handler code.  This change
adds support for queuing the next packet destined for the host so that
the USB irq handler can directly load it into the hardware.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Only enable double buffering transmit if
CONFIG_STM32_USB_DOUBLE_BUFFER_TX is set.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
@rogerlz
rogerlz merged commit ebf3c05 into main Oct 5, 2026
2 checks passed
@rogerlz
rogerlz deleted the klipper-pr-7143 branch October 5, 2026 11:47
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