From 767f2ce9a77606d438652edc5ac32d1ce4544907 Mon Sep 17 00:00:00 2001 From: Clayton Mills Date: Tue, 7 Jun 2022 11:44:36 +1000 Subject: [PATCH] stm32/usbd_conf: Remove disable of SYSCFG clock. System config block contains hardware unrelated to USB. So calling `__SYSCFG_CLK_DISABLE()` during `HAL_PCD_MspDeInit()` has an adverse effect on other system functionality. Removing call to `__SYSCFG_CLK_DISABLE()` to rectify this issue. This call was there since the beginning of the USB CDC code, added in b30c02afa078f7713faa14087ae28433dee49027. --- ports/stm32/usbd_conf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/stm32/usbd_conf.c b/ports/stm32/usbd_conf.c index 1fb2777831..d0f519d456 100644 --- a/ports/stm32/usbd_conf.c +++ b/ports/stm32/usbd_conf.c @@ -215,7 +215,6 @@ void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) { if (hpcd->Instance == USB_OTG_FS) { /* Disable USB FS Clocks */ __USB_OTG_FS_CLK_DISABLE(); - __SYSCFG_CLK_DISABLE(); return; } #endif @@ -224,7 +223,6 @@ void HAL_PCD_MspDeInit(PCD_HandleTypeDef *hpcd) { if (hpcd->Instance == USB_OTG_HS) { /* Disable USB FS Clocks */ __USB_OTG_HS_CLK_DISABLE(); - __SYSCFG_CLK_DISABLE(); } #endif