summaryrefslogtreecommitdiff
path: root/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
diff options
context:
space:
mode:
authorhenneboi <[email protected]>2023-12-08 13:34:42 +0100
committerhenneboi <[email protected]>2023-12-12 16:04:21 +0100
commit93c40b6966db53ce70f4bea6b8a72bf2986ac180 (patch)
treeb3689ff0bd3dce1a64dc1cb70bc12d35e8273bff /src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
parent59ecdb78fed4221c3e623d7ea9a9e69c3cd87aae (diff)
Add Support stm32h5 for stm32h573i based on stm32_fsdev G0 implementation Tested on Windows with IAR and gcc toolchain ( via cubeide) Tested only with audio examples, but sould be ok for other examples Cmake pacthed : but not tested Linux build : not tested Added a temporary workaround in make file to support H5 HAL repo ( ARMCC_VERSION=0)
Diffstat (limited to 'src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c')
-rw-r--r--src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
index 14cabaf8d..b0a00b7ee 100644
--- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
+++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
@@ -242,7 +242,7 @@ void dcd_init (uint8_t rhport)
}
USB->CNTR = 0; // Enable USB
-#ifndef STM32G0 // BTABLE register does not exist any more on STM32G0, it is fixed to USB SRAM base address
+#if !defined(STM32G0) && !defined(STM32H5) // BTABLE register does not exist any more on STM32G0, it is fixed to USB SRAM base address
USB->BTABLE = DCD_STM32_BTABLE_BASE;
#endif
USB->ISTR = 0; // Clear pending interrupts
@@ -357,6 +357,11 @@ void dcd_int_enable (uint8_t rhport)
#else
NVIC_EnableIRQ(USB_UCPD1_2_IRQn);
#endif
+
+
+#elif CFG_TUSB_MCU == OPT_MCU_STM32H5
+ NVIC_EnableIRQ(USB_DRD_FS_IRQn);
+
#elif CFG_TUSB_MCU == OPT_MCU_STM32WB
NVIC_EnableIRQ(USB_HP_IRQn);
@@ -414,6 +419,10 @@ void dcd_int_disable(uint8_t rhport)
#else
NVIC_DisableIRQ(USB_UCPD1_2_IRQn);
#endif
+
+#elif CFG_TUSB_MCU == OPT_MCU_STM32H5
+ NVIC_DisableIRQ(USB_DRD_FS_IRQn);
+
#elif CFG_TUSB_MCU == OPT_MCU_STM32WB
NVIC_DisableIRQ(USB_HP_IRQn);