You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: variants/PORTENTA_H7_M7/variant.cpp
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -235,6 +235,8 @@ void fixup3V1Rail() {
235
235
i2c.write(8 << 1, data, sizeof(data));
236
236
}
237
237
238
+
extern"C"voidlp_ticker_reconfigure_with_lsi();
239
+
238
240
voidinitVariant() {
239
241
RTCHandle.Instance = RTC;
240
242
// Turn off LED from bootloader
@@ -244,6 +246,19 @@ void initVariant() {
244
246
// Disable the FMC bank1 (enabled after reset)
245
247
// See https://github.com/STMicroelectronics/STM32CubeH7/blob/beced99ac090fece04d1e0eb6648b8075e156c6c/Projects/STM32H747I-DISCO/Applications/OpenAMP/OpenAMP_RTOS_PingPong/Common/Src/system_stm32h7xx.c#L215
246
248
FMC_Bank1_R->BTCR[0] = 0x000030D2;
249
+
// Check that the selected lsi clock is ok
250
+
if (__HAL_RCC_GET_LPTIM4_SOURCE() == RCC_LPTIM4CLKSOURCE_LSI) {
251
+
// rtc is not mounted, no need to do other actions
252
+
return;
253
+
}
254
+
// Use micros() to check the lptim precision
255
+
// if the error is > 1% , reconfigure the clock using lsi
0 commit comments