Removed the HAL_RCCEx_PeriphCLKConfig statement that was selecting the HSI48 CLK for USB. Assumption is that the STM32G4 reset value (defaults to HSI48 selected for USB) is preserved throughout Mbed initialization.

pull/13979/head
Tauno Magnusson 2021-01-26 03:27:37 +01:00
parent 80f0a378fb
commit 21176e903a
1 changed files with 0 additions and 18 deletions

View File

@ -121,15 +121,6 @@ MBED_WEAK uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
return 0; // FAIL
}
#if defined(DEVICE_TRNG) || defined(DEVICE_USBDEVICE)
// Connect the HSI48 Clock to drive the USB & RNG Clocks @ 48 MHz (CK48 Clock Mux)
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct) != HAL_OK) {
return 0; // FAIL
}
#endif
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
@ -184,15 +175,6 @@ uint8_t SetSysClock_PLL_HSI(void)
return 0; // FAIL
}
#if defined(DEVICE_TRNG) || defined(DEVICE_USBDEVICE)
// Connect the HSI48 Clock to drive the USB & RNG Clocks @ 48 MHz (CK48 Clock Mux)
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct) != HAL_OK) {
return 0; // FAIL
}
#endif
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;