2021-08-18 07:01 AM
On initialisation SystemClock_Config(0 calls the function HAL_RCC_OscConfig() and this generates a timeout on the loop below:
/* Set the new HSE configuration ---------------------------------------*/
__HAL_RCC_HSE_CONFIG(RCC_OscInitStruct->HSEState);
/* Check the HSE State */
if(RCC_OscInitStruct->HSEState != RCC_HSE_OFF)
{
/* Get Start Tick*/
tickstart = HAL_GetTick();
/* Wait till HSE is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == 0U)
{
if((uint32_t) (HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT; <<------
}
}
Any ideas what could be the cause of this and how to solve it?
thanks
2021-08-18 07:36 AM
Are you using a simulator or an RTOS?
What are your settings for the HSE timeout value (see block RCC, if created using CubeMX/CubeIDE)?
Regards
/Peter
2021-08-18 07:52 AM
regarding your questions:
>Are you using a simulator or an RTOS?
I'm using FreeRTOS
The HAL_Ticker seems to be working fine.
>What are your settings for the HSE timeout value (see block RCC, if created using CubeMX/CubeIDE)?
I have used CubeMX to generate the configuration.
I'm using a STM32H7A3 processor on a Nucleo board, and somehow the RCC was wrong.
Now it's High Speed Clocmk = Crystal/Ceramic Resonator
Low Speed Clock: Disable
(For some reason it was enabling the Low Speed Clock!)
Still I have a problem now:
When is calling HAL_GetTick() on the second call below it generates an error: <signal handler called>() at 0xfffffff9
/* Get Start Tick*/
tickstart = HAL_GetTick();
while (__HAL_RCC_GET_SYSCLK_SOURCE() != (RCC_ClkInitStruct->SYSCLKSource << RCC_CFGR_SWS_Pos))
{
if((HAL_GetTick() - tickstart ) > CLOCKSWITCH_TIMEOUT_VALUE) <----
{
return HAL_TIMEOUT;
}
}
2022-08-23 04:05 AM
I have the same issue, a custom board that was already working i created a simple project and never gets pass SystemClock_Config();
Doesnt matter if i use HSE or HSI
my timeout values are the default ones