Skip to content

Commit 21176e9

Browse files
author
Tauno Magnusson
committed
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.
1 parent 80f0a37 commit 21176e9

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G431xB/system_clock.c

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,6 @@ MBED_WEAK uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
121121
return 0; // FAIL
122122
}
123123

124-
#if defined(DEVICE_TRNG) || defined(DEVICE_USBDEVICE)
125-
// Connect the HSI48 Clock to drive the USB & RNG Clocks @ 48 MHz (CK48 Clock Mux)
126-
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
127-
RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
128-
if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct) != HAL_OK) {
129-
return 0; // FAIL
130-
}
131-
#endif
132-
133124
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
134125
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
135126
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
@@ -184,15 +175,6 @@ uint8_t SetSysClock_PLL_HSI(void)
184175
return 0; // FAIL
185176
}
186177

187-
#if defined(DEVICE_TRNG) || defined(DEVICE_USBDEVICE)
188-
// Connect the HSI48 Clock to drive the USB & RNG Clocks @ 48 MHz (CK48 Clock Mux)
189-
RCC_PeriphCLKInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB;
190-
RCC_PeriphCLKInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_HSI48;
191-
if (HAL_RCCEx_PeriphCLKConfig(&RCC_PeriphCLKInitStruct) != HAL_OK) {
192-
return 0; // FAIL
193-
}
194-
#endif
195-
196178
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
197179
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
198180
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;

0 commit comments

Comments
 (0)