summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-04-02 17:11:22 +0700
committerhathach <[email protected]>2024-04-02 17:11:22 +0700
commitf2859287df706e8016d661eea90a8c0b79d9d8a4 (patch)
treebcd1c7c1719b078f74be8f2246a9cdee6d3fce99
parent4b993708c966977de082a2087865163df7186b2c (diff)
check for PWR_USBSCR_USB33DEN before enabling USB VDD
-rw-r--r--hw/bsp/stm32h5/boards/stm32h503nucleo/board.h4
-rw-r--r--hw/bsp/stm32h5/boards/stm32h563nucleo/board.h4
-rw-r--r--hw/bsp/stm32h5/boards/stm32h573i_dk/board.h5
-rw-r--r--hw/bsp/stm32h5/family.c4
4 files changed, 3 insertions, 14 deletions
diff --git a/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h b/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h
index 531f00425..da20cfa3a 100644
--- a/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h
+++ b/hw/bsp/stm32h5/boards/stm32h503nucleo/board.h
@@ -115,10 +115,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
-static inline void board_enable_vdd_usb(void) {
- // USB in STM32H503RB does not require enabling VDD
-}
-
#ifdef __cplusplus
}
#endif
diff --git a/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h b/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h
index 13eaed6aa..8e849f5c8 100644
--- a/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h
+++ b/hw/bsp/stm32h5/boards/stm32h563nucleo/board.h
@@ -122,10 +122,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
-static inline void board_enable_vdd_usb(void) {
- /* Enable VDDUSB to power on USB peripheral */
- HAL_PWREx_EnableVddUSB();
-}
#ifdef __cplusplus
}
#endif
diff --git a/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h b/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h
index b98939cc1..674cf8e2a 100644
--- a/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h
+++ b/hw/bsp/stm32h5/boards/stm32h573i_dk/board.h
@@ -108,11 +108,6 @@ static inline void SystemClock_Config(void) {
__HAL_RCC_USB_CLK_ENABLE();
}
-static inline void board_enable_vdd_usb(void) {
- /* Enable VDDUSB to power on USB peripheral */
- HAL_PWREx_EnableVddUSB();
-}
-
#ifdef __cplusplus
}
#endif
diff --git a/hw/bsp/stm32h5/family.c b/hw/bsp/stm32h5/family.c
index 4eb846933..81c0ef4ce 100644
--- a/hw/bsp/stm32h5/family.c
+++ b/hw/bsp/stm32h5/family.c
@@ -145,7 +145,9 @@ void board_init(void) {
__HAL_RCC_USB_CLK_ENABLE();
/* Enable VDDUSB */
- board_enable_vdd_usb();
+ #if defined (PWR_USBSCR_USB33DEN)
+ HAL_PWREx_EnableVddUSB();
+ #endif
}
//--------------------------------------------------------------------+