cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_RCC_OscConfig timeout

EGonc.3
Associate II

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

3 REPLIES 3
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
EGonc.3
Associate II

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;

     }

    }

Javier1
Principal

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

0693W00000QOIsNQAX.png

we dont need to firmware by ourselves, lets talk