Skip to content

Commit

Permalink
check for PWR_USBSCR_USB33DEN before enabling USB VDD
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Apr 2, 2024
1 parent 4b99370 commit f285928
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
4 changes: 0 additions & 4 deletions hw/bsp/stm32h5/boards/stm32h503nucleo/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions hw/bsp/stm32h5/boards/stm32h563nucleo/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions hw/bsp/stm32h5/boards/stm32h573i_dk/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion hw/bsp/stm32h5/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

//--------------------------------------------------------------------+
Expand Down

0 comments on commit f285928

Please sign in to comment.