update stm32u5xx_hal_driver, fix build with old u575 board

This commit is contained in:
hathach 2023-10-31 12:08:45 +07:00
parent 214a4afa6a
commit 3e140756dc
No known key found for this signature in database
GPG Key ID: F5D50C6D51D17CBA
2 changed files with 10 additions and 9 deletions

View File

@ -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

View File

@ -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',