feat(usb): add STM32C5 HAL v2 USB device support - #3059
Open
cumin777 wants to merge 1 commit into
Open
Conversation
5 tasks
cumin777
force-pushed
the
feat/stm32c5-halv2-usb
branch
from
August 27, 2026 08:02
23c243f to
50a4eea
Compare
Contributor
Author
|
Follow-up: after checking the STM32C5 HAL source, I replaced the temporary direct |
This was referenced Aug 27, 2026
Contributor
Author
|
Follow-up split PRs are now open for the remaining shared pieces: #3060 contains the HAL v2 UART helper compatibility fix, and #3061 contains the generic UF2 upload recipe. The UF2 recipe invokes the |
fpistm
self-requested a review
August 27, 2026 11:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds STM32C5 HAL v2 USB device support to the shared USBDevice library.
This PR implements the following features:
HAL_PCD_DeviceDisconnect()and the matchingHAL_PCD_Start()attach pathMotivation
The Seeed XIAO STM32C5 uses the STM32C5 HAL v2 USB device peripheral. The shared USBDevice library currently has no HAL v2 low-level adapter, so the board cannot provide USB CDC through the normal Arduino core path.
This change is intentionally separated from the XIAO board definition so the common USB implementation can be reviewed independently. The initial split first used a direct
PA_12GPIO detach inusbd_if.c; after checking the STM32C5 HAL, this was replaced with the HAL PCD device-connect API. The common re-enumeration helper no longer contains a C5-specific pin reference.Validation
USB CDC enumeration, serial communication and sustained CDC transfers were validated on Seeed XIAO STM32C5. The C5 CDC PMA endpoints are configured as non-overlapping single-buffer areas.
Code formatting
Closing issues
N/A