Skip to content

Commit 76383da

Browse files
committed
[STM32MP157_DK] Add missing clock configuration
in engineering mode only. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 2130494 commit 76383da

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

variants/STM32MP157_DK/variant.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ const PinName digitalPin[] = {
110110
ANA_1, //A3 - D22, D50 - ADC1_INP1
111111
PC_3, //A4 - D23, D51 - ADC1_INP13, or PA_12 (D14) with SB23 ON / SB24 OFF
112112
PF_12 //A5 - D24, D52 - ADC1_INP6, or PA_11 (D15) with SB25 ON / SB26 OFF
113-
// // Duplicated pins in order to be aligned with PinMap_ADC
114113
};
115114

116115
#ifdef __cplusplus
@@ -150,6 +149,7 @@ void SystemClock_Config(void)
150149

151150
RCC_OscInitTypeDef RCC_OscInitStruct = {};
152151
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
152+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
153153

154154
/**Configure LSE Drive Capability
155155
*/
@@ -254,6 +254,19 @@ void SystemClock_Config(void)
254254
/**Set the HSE division factor for RTC clock
255255
*/
256256
__HAL_RCC_RTC_HSEDIV(24);
257+
258+
/* Configure ADCx clock prescaler */
259+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
260+
PeriphClkInit.AdcClockSelection = RCC_ADCCLKSOURCE_PER;
261+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
262+
Error_Handler();
263+
}
264+
265+
/* Configure VREFBUF */
266+
__HAL_RCC_VREF_CLK_ENABLE();
267+
HAL_SYSCFG_VREFBUF_HighImpedanceConfig(SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE);
268+
HAL_SYSCFG_EnableVREFBUF();
269+
257270
}
258271

259272
#ifdef __cplusplus

0 commit comments

Comments
 (0)