From a9d04ed0a23415b41553702eaee301da5bd5cad5 Mon Sep 17 00:00:00 2001 From: Yuuki NAGAO Date: Sat, 5 Jul 2025 22:32:26 +0900 Subject: [PATCH] stm32/usbd_conf: Change USB pin configuration for STM32H7A3. STM32H7A3 uses PA11, PA12 to enable USB function via built-in USB OTG port on NUCLEO board. Signed-off-by: Yuuki NAGAO --- ports/stm32/usbd_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm32/usbd_conf.c b/ports/stm32/usbd_conf.c index 7a9e63c9f3..d4af54b729 100644 --- a/ports/stm32/usbd_conf.c +++ b/ports/stm32/usbd_conf.c @@ -182,7 +182,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) { // Configure USB GPIO's. - #if defined(STM32H723xx) + #if defined(STM32H723xx) || (STM32H7A3xx) || defined(STM32H7A3xxQ) // These MCUs don't have an alternate function for USB but rather require // the pins to be disconnected from all peripherals, ie put in analog mode. @@ -204,7 +204,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) { // Other MCUs have an alternate function for GPIO's to be in USB mode. - #if defined(STM32H7A3xx) || defined(STM32H7A3xxQ) || defined(STM32H7B3xx) || defined(STM32H7B3xxQ) + #if defined(STM32H7B3xx) || defined(STM32H7B3xxQ) const uint32_t otg_alt = GPIO_AF10_OTG1_FS; #elif defined(STM32H7) const uint32_t otg_alt = GPIO_AF12_OTG2_FS;