feat(usb): add STM32C5 HAL v2 USB device support - #3059
Conversation
23c243f to
50a4eea
Compare
|
Follow-up: after checking the STM32C5 HAL source, I replaced the temporary direct |
|
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 |
|
Hi @cumin777 I've fixed the build issue but could not get USB working yet. |
The #error directive under #ifndef USE_HAL_PCD_MODULE needs a 2-space preprocessor indentation to satisfy the repository astyle check (indent=spaces=2, indent-preproc-block). Co-Authored-By: Claude <noreply@anthropic.com>
a4017f0 to
157cb05
Compare
|
@fpistm Apologies — the revision you tested (50a4eea) was missing follow-up fixes that existed only on our local integration branch and had not been synced to this PR. They are pushed now:
I tested on the xiao-stm32c5, and the USB CDC enumeration and log output were all normal. If you encounter any other issues, please let me know and I will follow up to fix them.Thanks. :) |
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