STM32F4 DISCOVERY Start up HSI Stability Lockup Resolved
Posted: Tue Jun 17, 2014 2:47 pm
Hello,
I am new to ARM development and very new to ChibiOs.
After working with the ChibiOS example project for the STM32F4Discovery board yesterday I noticed that the program would not boot up.
the firmware was stuck in a while loop waiting for the internal high speed oscillator (HSI) to become stable.
The lockup occurs in hal_lld.c around line 170.
/* HSI setup, it enforces the reset situation in order to handle possible
problems with JTAG probes and re-initializations.*/
RCC->CR |= RCC_CR_HSION; /* Make sure HSI is ON. */
while (!(RCC->CR & RCC_CR_HSIRDY)) // <---- Startup Init Lockup is HERE.
; /* Wait until HSI is stable. */
To fix the lockup I found it necessary to set STM32_NO_INIT to TRUE in mcuconf.h
//#define STM32_NO_INIT FALSE
#define STM32_NO_INIT TRUE // Resolves HSI startup lock.
The above modification allows the board to boot and run the example project.
I also noticed that the External clock frequency was wrong for matching my Discovery board.
I have an 8MHz oscillator installed. This was the factory setting.
This is found in stm32f4xx.h (Line 122)
#if !defined (HSE_VALUE)
// 06/16/2014 FJD modified to match our 8MHz external crystal oscillator.
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
I hope this helps anyone else who is working at getting ChibiOS up and running on the STM32F4DISCOVERY board.
Cheers,
Forrest
I am new to ARM development and very new to ChibiOs.
After working with the ChibiOS example project for the STM32F4Discovery board yesterday I noticed that the program would not boot up.
the firmware was stuck in a while loop waiting for the internal high speed oscillator (HSI) to become stable.
The lockup occurs in hal_lld.c around line 170.
/* HSI setup, it enforces the reset situation in order to handle possible
problems with JTAG probes and re-initializations.*/
RCC->CR |= RCC_CR_HSION; /* Make sure HSI is ON. */
while (!(RCC->CR & RCC_CR_HSIRDY)) // <---- Startup Init Lockup is HERE.
; /* Wait until HSI is stable. */
To fix the lockup I found it necessary to set STM32_NO_INIT to TRUE in mcuconf.h
//#define STM32_NO_INIT FALSE
#define STM32_NO_INIT TRUE // Resolves HSI startup lock.
The above modification allows the board to boot and run the example project.
I also noticed that the External clock frequency was wrong for matching my Discovery board.
I have an 8MHz oscillator installed. This was the factory setting.
This is found in stm32f4xx.h (Line 122)
#if !defined (HSE_VALUE)
// 06/16/2014 FJD modified to match our 8MHz external crystal oscillator.
#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
I hope this helps anyone else who is working at getting ChibiOS up and running on the STM32F4DISCOVERY board.
Cheers,
Forrest