These changes should fix it (I also changed the comments at the #endifs that got misplaced for HSE and CSI):
Code: Select all
--- a/os/hal/ports/STM32/STM32H7xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32H7xx/hal_lld.c
@@ -276,14 +276,21 @@ void stm32_clock_init(void) {
#endif
while ((RCC->CR & RCC_CR_HSERDY) == 0)
; /* Waits until HSE is stable. */
-#endif
+#endif /* STM32_HSE_ENABLED == TRUE */^M
+^M
+ /* HSI48 activation.*/^M
+#if STM32_HSI48_ENABLED == TRUE^M
+ RCC->CR |= RCC_CR_HSI48ON;^M
+ while ((RCC->CR & RCC_CR_HSI48RDY) == 0)^M
+ ; /* Waits until HSI48 is stable. */
^M
+#endif /* STM32_HSI48_ENABLED == TRUE */^M
/* CSI activation.*/
#if STM32_CSI_ENABLED == TRUE
RCC->CR |= RCC_CR_CSION;
while ((RCC->CR & RCC_CR_CSIRDY) == 0)
; /* Waits until CSI is stable. */
-#endif /* STM32_HSE_ENABLED == TRUE */
+#endif /* STM32_CSI_ENABLED == TRUE */^M
/* LSI activation.*/
#if STM32_LSI_ENABLED == TRUE
GB