@@ -70,15 +70,20 @@ WEAK void SystemClock_Config(void)
70
70
RCC_OscInitTypeDef RCC_OscInitStruct = {};
71
71
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
72
72
73
+ /* * Configure LSE Drive Capability
74
+ */
75
+ HAL_PWR_EnableBkUpAccess ();
76
+ __HAL_RCC_LSEDRIVE_CONFIG (RCC_LSEDRIVE_LOW);
73
77
/* * Configure the main internal regulator output voltage
74
78
*/
75
- __HAL_PWR_VOLTAGESCALING_CONFIG (PWR_REGULATOR_VOLTAGE_SCALE2 );
79
+ __HAL_PWR_VOLTAGESCALING_CONFIG (PWR_REGULATOR_VOLTAGE_SCALE1 );
76
80
/* * Initializes the CPU, AHB and APB busses clocks
77
81
*/
78
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
82
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE | RCC_OSCILLATORTYPE_MSI;
83
+ RCC_OscInitStruct.LSEState = RCC_LSE_ON;
79
84
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
80
85
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
81
- RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6 ;
86
+ RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11 ;
82
87
RCC_OscInitStruct.PLL .PLLState = RCC_PLL_NONE;
83
88
if (HAL_RCC_OscConfig (&RCC_OscInitStruct) != HAL_OK) {
84
89
Error_Handler ();
@@ -94,12 +99,12 @@ WEAK void SystemClock_Config(void)
94
99
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
95
100
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
96
101
97
- if (HAL_RCC_ClockConfig (&RCC_ClkInitStruct, FLASH_LATENCY_0 ) != HAL_OK) {
102
+ if (HAL_RCC_ClockConfig (&RCC_ClkInitStruct, FLASH_LATENCY_2 ) != HAL_OK) {
98
103
Error_Handler ();
99
104
}
100
105
}
101
106
102
107
#ifdef __cplusplus
103
108
}
104
109
#endif
105
- #endif /* ARDUINO_GENERIC_* */
110
+ #endif /* ARDUINO_GENERIC_NODE_SE_TTI */
0 commit comments