From bfb3c1c247236db75aaef28b4a64600aa0f2e2ea Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 15 Nov 2024 09:46:56 +0100 Subject: [PATCH] feat(core): support 32MHz HSE in USB driver (HS internal PHY only) [no changelog] --- core/embed/io/usb/stm32/usbd_conf.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/embed/io/usb/stm32/usbd_conf.c b/core/embed/io/usb/stm32/usbd_conf.c index 1313eeb952..ae6c5fe2d5 100644 --- a/core/embed/io/usb/stm32/usbd_conf.c +++ b/core/embed/io/usb/stm32/usbd_conf.c @@ -226,7 +226,13 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef *hpcd) /** Set the OTG PHY reference clock selection */ +#if HSE_VALUE == 16000000 HAL_SYSCFG_SetOTGPHYReferenceClockSelection(SYSCFG_OTG_HS_PHY_CLK_SELECT_1); +#elif HSE_VALUE == 32000000 + HAL_SYSCFG_SetOTGPHYReferenceClockSelection(SYSCFG_OTG_HS_PHY_CLK_SELECT_6); +#else +#error Unsupported HSE frequency +#endif /* Peripheral clock enable */ __HAL_RCC_USB_OTG_HS_CLK_ENABLE();