Skip to content

[DNM]: Stm32c5 halv2 usb rework - #22

Merged
fpistm merged 5 commits into
mainfrom
stm32c5-halv2-usb_rework
Sep 17, 2026
Merged

fpistm merged 5 commits into
mainfrom
stm32c5-halv2-usb_rework

Conversation

@fpistm

@fpistm fpistm commented Sep 15, 2026

Copy link
Copy Markdown
Owner

This PR is a review/rework of the stm32duino#3059

This PR is functional on Nucleo C562RE (single or double buffer).

/cc @cumin777

cumin777 and others added 5 commits September 15, 2026 16:16
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
Signed-off-by: cumin <13809292481@163.com>
Signed-off-by: cumin <13809292481@163.com>
also enable USB double buffer for HALv2

Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
@cumin777

Copy link
Copy Markdown

Hi @fpistm, thanks for the rework — reviewed, tested, and force-pushed into stm32duino#3059.

Review

On hardware (XIAO STM32C5, same USB_DRD_FS IP as your C562RE)

  • Both the default double-buffer and the -DUSBD_CDC_USE_SINGLE_BUFFER builds compiled clean (HAL v2 adapter in artifacts).
  • Flashed and enumerated; CDC TX-RX verified: AT round-trips, +READY 170 ms after DTR, 64KB echo loopback with zero bit errors (~267 KB/s).
  • Two 5-minute stability runs: 60/60 heartbeats, ~88 MB loopback traffic, no re-enumeration.

Observation on the XIAO (follow-up needed)

  • Single write() bursts above ~256 bytes intermittently echo fewer bytes than sent (e.g. 320/512, 640/1024, always a multiple of 64); ≤256 B writes are lossless across 88 MB.
  • Present identically in the pre-rework revision of this PR, so not introduced by the rework itself — but both revisions carry the new HAL v2 USB adapter, so I can't yet tell whether it's an adapter-level issue. I'm tracing which direction drops (RX vs TX) and will follow up.

ARM64 and other hosts remain untested on my side, as before.

@fpistm

fpistm commented Sep 17, 2026

Copy link
Copy Markdown
Owner Author

Thanks @cumin777

About your issue, could you try with this PR:
stm32duino#3058

@fpistm
fpistm merged commit 5ff5414 into main Sep 17, 2026
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.

2 participants