stm32: Update STM32L452xx Multi OTG handling.

Added custom Multi OTG handling for STM32L452xx, based on STM32L432xx
handling.

Fixes issue #15795.

Signed-off-by: Adrian Higgins <adrian@higstar.com>
This commit is contained in:
Adrian Higgins 2024-09-05 14:50:20 +10:00 committed by Damien George
parent f1bdac3752
commit 39ddfed9a0
3 changed files with 4 additions and 4 deletions

View File

@ -619,7 +619,7 @@
// Whether the USB peripheral is device-only, or multiple OTG // Whether the USB peripheral is device-only, or multiple OTG
// For STM32G0 and STM32H5 the USB peripheral supports device and host mode, // For STM32G0 and STM32H5 the USB peripheral supports device and host mode,
// but otherwise acts like a non-multi-OTG peripheral. // but otherwise acts like a non-multi-OTG peripheral.
#if defined(STM32G0) || defined(STM32G4) || defined(STM32H5) || defined(STM32L0) || defined(STM32L1) || defined(STM32L432xx) || defined(STM32WB) #if defined(STM32G0) || defined(STM32G4) || defined(STM32H5) || defined(STM32L0) || defined(STM32L1) || defined(STM32L432xx) || defined(STM32L452xx) || defined(STM32WB)
#define MICROPY_HW_USB_IS_MULTI_OTG (0) #define MICROPY_HW_USB_IS_MULTI_OTG (0)
#else #else
#define MICROPY_HW_USB_IS_MULTI_OTG (1) #define MICROPY_HW_USB_IS_MULTI_OTG (1)

View File

@ -312,7 +312,7 @@ void USB_DRD_FS_IRQHandler(void) {
} }
#endif #endif
#elif defined(STM32L0) || defined(STM32L432xx) #elif defined(STM32L0) || defined(STM32L432xx) || defined(STM32L452xx)
#if MICROPY_HW_USB_FS #if MICROPY_HW_USB_FS
void USB_IRQHandler(void) { void USB_IRQHandler(void) {

View File

@ -93,7 +93,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) {
const uint32_t otg_alt = GPIO_AF10_OTG1_FS; const uint32_t otg_alt = GPIO_AF10_OTG1_FS;
#elif defined(STM32L0) #elif defined(STM32L0)
const uint32_t otg_alt = GPIO_AF0_USB; const uint32_t otg_alt = GPIO_AF0_USB;
#elif defined(STM32L432xx) #elif defined(STM32L432xx) || defined(STM32L452xx)
const uint32_t otg_alt = GPIO_AF10_USB_FS; const uint32_t otg_alt = GPIO_AF10_USB_FS;
#elif defined(STM32H5) || defined(STM32WB) #elif defined(STM32H5) || defined(STM32WB)
const uint32_t otg_alt = GPIO_AF10_USB; const uint32_t otg_alt = GPIO_AF10_USB;
@ -156,7 +156,7 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) {
#elif defined(STM32L0) #elif defined(STM32L0)
NVIC_SetPriority(USB_IRQn, IRQ_PRI_OTG_FS); NVIC_SetPriority(USB_IRQn, IRQ_PRI_OTG_FS);
HAL_NVIC_EnableIRQ(USB_IRQn); HAL_NVIC_EnableIRQ(USB_IRQn);
#elif defined(STM32L432xx) #elif defined(STM32L432xx) || defined(STM32L452xx)
NVIC_SetPriority(USB_FS_IRQn, IRQ_PRI_OTG_FS); NVIC_SetPriority(USB_FS_IRQn, IRQ_PRI_OTG_FS);
HAL_NVIC_EnableIRQ(USB_FS_IRQn); HAL_NVIC_EnableIRQ(USB_FS_IRQn);
#elif defined(STM32G4) || defined(STM32L1) || defined(STM32WB) #elif defined(STM32G4) || defined(STM32L1) || defined(STM32WB)