We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 920db63 commit 0fecc56Copy full SHA for 0fecc56
targets/TARGET_STM/mbed_overrides.c
@@ -54,5 +54,21 @@ void mbed_sdk_init()
54
SetSysClock();
55
SystemCoreClockUpdate();
56
57
+ /* Start LSI clock for RTC */
58
+#if DEVICE_RTC
59
+#if !MBED_CONF_TARGET_LSE_AVAILABLE
60
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
61
+
62
+ if (__HAL_RCC_GET_RTC_SOURCE() != RCC_RTCCLKSOURCE_NO_CLK) {
63
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI;
64
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
65
+ RCC_OscInitStruct.LSIState = RCC_LSI_ON;
66
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
67
+ error("Init : cannot initialize LSI\n");
68
+ }
69
70
+#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
71
+#endif /* DEVICE_RTC */
72
73
mbed_sdk_inited = 1;
74
}
0 commit comments