Browse Source

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>
pull/15796/head
Adrian Higgins 2 months ago
committed by Damien George
parent
commit
39ddfed9a0
  1. 2
      ports/stm32/mpconfigboard_common.h
  2. 2
      ports/stm32/stm32_it.c
  3. 4
      ports/stm32/usbd_conf.c

2
ports/stm32/mpconfigboard_common.h

@ -619,7 +619,7 @@
// Whether the USB peripheral is device-only, or multiple OTG
// For STM32G0 and STM32H5 the USB peripheral supports device and host mode,
// 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)
#else
#define MICROPY_HW_USB_IS_MULTI_OTG (1)

2
ports/stm32/stm32_it.c

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

4
ports/stm32/usbd_conf.c

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

Loading…
Cancel
Save