cancel
Showing results for 
Search instead for 
Did you mean: 

READ_BIT(RCC->CR, RCC_CR_HSERDY) fails with a HAL_TIMEOUT when running blinky in debug.

lwatcdr
Associate II

While in debug I get and error in this line of code. I do not get an error when running code not in debug.

/* Wait till HSE is ready */
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if ((HAL_GetTick() - tickstart) > HSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}

SBC NUCLEO-U5A5ZJ-Q

CUBEMX IDE

12 REPLIES 12

So why does it fail only in debug but when I run not in debug.

I don't know. The important thing is to get the code correct. You should verify on your board this is actually the case.

Where do I set the HSE to 16Mhz.

In the clock configuration tab:

TDK_1-1727129356337.png

 

If you feel a post has answered your question, please click "Accept as Solution".
Roger SHIVELY
ST Employee

Hello @lwatcdr 

This post has been escalated to the ST Online Support Team for additional assistance.  We'll contact you directly.

 

Regards,

Roger

ST Support

I am encountering the same mentioned problem. Could you please share the solution or any guidance on how to resolve it?