HSI48 not getting enabled on STM32H7 Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
geebee
Posts: 33
Joined: Thu Dec 06, 2018 10:22 pm
Has thanked: 4 times
Been thanked: 15 times

HSI48 not getting enabled on STM32H7  Topic is solved

Postby geebee » Fri Jul 10, 2020 8:08 pm

hal_lld.h provides constants for HSI48, but when it's enabled and used in the configuration it does not actually get enabled.
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

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: HSI48 not getting enabled on STM32H7

Postby Giovanni » Wed Jul 22, 2020 10:19 am

Thanks, fixed as bug #1114.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 15 guests