summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-10-31 12:08:45 +0700
committerhathach <[email protected]>2023-10-31 12:08:45 +0700
commit3e140756dc5e3761209bf5b399621e6c0ed1dadd (patch)
treecf64a557f0bbdef6ff44979673716fd5e61069f7
parent214a4afa6aafe9daac6c1c304eb305b44e8cf86d (diff)
update stm32u5xx_hal_driver, fix build with old u575 board
-rw-r--r--hw/bsp/stm32u5/family.c17
-rw-r--r--tools/get_deps.py2
2 files changed, 10 insertions, 9 deletions
diff --git a/hw/bsp/stm32u5/family.c b/hw/bsp/stm32u5/family.c
index dd22b7d45..d2287e9fc 100644
--- a/hw/bsp/stm32u5/family.c
+++ b/hw/bsp/stm32u5/family.c
@@ -37,10 +37,11 @@
#pragma GCC diagnostic pop
#endif
-static void Error_Handler(void) {
+#include "bsp/board_api.h"
+
+TU_ATTR_UNUSED static void Error_Handler(void) {
}
-#include "bsp/board_api.h"
#include "board.h"
//--------------------------------------------------------------------+
@@ -152,12 +153,6 @@ void board_init(void) {
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- /* Enable USB power on Pwrctrl CR2 register */
- HAL_PWREx_EnableVddUSB();
-
- /* USB clock enable */
- __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
-
// Enable VBUS sense (B device) via pin PA9
USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN;
#else
@@ -169,6 +164,12 @@ void board_init(void) {
USB_OTG_FS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL;
#endif // vbus sense
+ /* Enable USB power on Pwrctrl CR2 register */
+ HAL_PWREx_EnableVddUSB();
+
+ /* USB clock enable */
+ __HAL_RCC_USB_OTG_FS_CLK_ENABLE();
+
#else
// STM59x/Ax/Fx/Gx only have 1 USB HS port
diff --git a/tools/get_deps.py b/tools/get_deps.py
index 8f93ca61f..a0121f400 100644
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -153,7 +153,7 @@ deps_optional = {
'675c32a75df37f39d50d61f51cb0dcf53f07e1cb',
'stm32l5'],
'hw/mcu/st/stm32u5xx_hal_driver': ['https://github.com/STMicroelectronics/stm32u5xx_hal_driver.git',
- '2e1d4cdb386e33391cb261dfff4fefa92e4aa35a',
+ '4d93097a67928e9377e655ddd14622adc31b9770',
'stm32u5'],
'hw/mcu/st/stm32wbxx_hal_driver': ['https://github.com/STMicroelectronics/stm32wbxx_hal_driver.git',
'2c5f06638be516c1b772f768456ba637f077bac8',