feat: add Seeed XIAO STM32C5 support - #3048
Conversation
| #define USB USB_DRD_FS | ||
| #define PCD_SNG_BUF HAL_PCD_SNG_BUF | ||
| #define PCD_DBL_BUF HAL_PCD_DBL_BUF |
There was a problem hiding this comment.
It would be better to add it in the stm32_def.h, other series also redefine some USB definition.
Arduino_Core_STM32/libraries/SrcWrapper/inc/stm32_def.h
Lines 206 to 224 in 36a8f85
USB_BASE should also be defined.
| #define USB_IRQn USB_DRD_FS_IRQn | ||
| #define USB_IRQHandler USB_DRD_FS_IRQHandler |
There was a problem hiding this comment.
When USB_BASE defined simply add STM32C5xx in the list:
There was a problem hiding this comment.
I think it should be renamed to a more generic name like: usbd_confv2.c
| @@ -0,0 +1,251 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file usbd_conf_c5.c | |||
| /** | ||
| ****************************************************************************** | ||
| * @file usbd_conf_c5.c | ||
| * @brief STM32C5 HAL v2 USB device low-level adapter. |
| } | ||
|
|
||
| #if defined(SPI_IFCR_EOTC) | ||
| spi_transfer_end: |
There was a problem hiding this comment.
I think there is a trap here. For future HALV2 series based. If SPI_IFCR_EOTC is not defined goto will not reach it.
| static bool spi_transfer_timed_out(uint32_t start_us) | ||
| { | ||
| return (SPI_TRANSFER_TIMEOUT != HAL_MAX_DELAY) | ||
| && ((uint32_t)(micros() - start_us) >= (SPI_TRANSFER_TIMEOUT * 1000UL)); |
There was a problem hiding this comment.
micros() uses HAL_GetTick() so wonder if your statement is correct?
| void SPIClass::configSpi(const SPISettings &settings, bool force) | ||
| { | ||
| if (_spiSettings != settings) { | ||
| if (force || _spiSettings != settings) { |
There was a problem hiding this comment.
Interesting.
It seems we introduce a regression when the ArduinoCore-API was released.
Thanks for pointing this. I will provide a fix for this. I don't think adding a new arguments is the better way.
There was a problem hiding this comment.
Could you file an issue for this, please?
| #define PIN_SPI_SS2 NUM_DIGITAL_PINS | ||
| #define PIN_SPI_SS3 NUM_DIGITAL_PINS | ||
| #define PIN_SPI_MOSI PB_15_ALT2 | ||
| #define PIN_SPI_MOSI (PB15 | ALT2) |
c6bd5f4 to
b9e53e9
Compare
|
Hi @fpistm, thank you for the detailed first review.
|
|
Hi, thanks for the update. As the board is not yet available. It would be fine to keep here only the board support addition and open separate PR for specific feature. I will try on my side and a Nucleo C562RE |
|
Hi @fpistm, understood. I will open an issue for this. Although the board does not yet have a public product page, I can provide test reports to demonstrate the product and its validation status. Our product manager is working to ensure Arduino platform support is ready as early as possible for our users. If helpful, I would be glad to share this information with you. The current planned public launch date is August 29. Thank you very much for your support. |
|
I also noticed that the CI workflows for the latest update are awaiting approval. Could you please approve them when convenient, so the checks can run? :) |
|
Thanks for the update. Will check this tomorrow. |
Summary
Add Arduino core support for the Seeed XIAO STM32C5.
This PR implements the following features:
Serialsupport for STM32C5 HAL v2The board requires support for the STM32C5 HAL v2 USB device peripheral and
uses a 32 KiB TinyUF2 bootloader, so the application image starts at
0x08008000.The application USB identity is
2886:80C5. The corresponding bootloader ismaintained separately with identity
2886:00C5.Automatic upload uses the standard 1200-bps CDC touch flow to enter TinyUF2,
then writes the generated UF2 image to the
XIAOC5BOOTmass-storage volume.The
uf2uploadexecutable is supplied by the companion Arduino_Tools PR andwill be consumed through a subsequent STM32Tools release/package-index update.
Validation
Hardware validation was performed on Seeed XIAO STM32C5:
automatic UF2 upload
CI and AStyle checks are pending GitHub Actions.