Skip to main content
Associate
September 2, 2025
Question

STM32WBA52 RTC Stop

  • September 2, 2025
  • 2 replies
  • 1109 views

It was working fine before, but has now stopped working. Upon investigation, we found that the RTC crystal oscillator is not oscillating. It won't return to normal with a reset. An investigation with the crystal oscillator manufacturer found no problems. Debugging showed a timeout at the following code. Do you know what the cause might be?

 

/* Get Start Tick*/
tickstart = HAL_GetTick();

/* Wait till LSE is ready */
while (READ_BIT(RCC->BDCR1, RCC_BDCR1_LSERDY) == 0U)
{
if ((HAL_GetTick() - tickstart) > RCC_LSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}

2 replies

ST Employee
September 3, 2025

Hello,

Could you please remove the timeout code to keep only :

while (READ_BIT(RCC->BDCR1, RCC_BDCR1_LSERDY) == 0U);
return HAL_TIMEOUT;

 

if you are looping there for ever, that could mean there something wrong with the LSE.

If you are getting out, that could mean there is something wrong with the Systick configuration.

Regards.

 

 

Associate
September 11, 2025

Hello,

It's looping forever

[while (READ_BIT(RCC->BDCR1, RCC_BDCR1_LSERDY) == 0U);]

.

I checked for about 5 minutes, but I couldn't see it exiting the loop.

The crystal oscillator seems to be OK, so is it possible that the IC has a hardware failure?

Thank you.

ST Employee
September 11, 2025

Hello,

Last check is to make sure LSEON bit is set in the same RCC_BDCR1 register.

In case it is set to '1' as expected, then I believe there is a hardware failure.

I would try with the same SW binary and a different IC to check whereas this is related to the IC or the external crystal.

 

Alternatively, on the same IC, did you try any ST unmodified example using LSE ? If they are failing, I don't see any other root cause than HW.

 

Regards.

STTwo-32
Technical Moderator
September 19, 2025

Hello @userwba52etc 

If you wild like to have a failure analysis done through my distributor. I suggest you contact them. 

Best Regards.

STTwo-32

Associate
September 24, 2025

Hello,

I was refused a hardware analysis.

What do you think could be the cause?

I think it would occur if there was no oscillation, but would it occur if the frequency deviation was large?

If so, what would the threshold be?

Thank you.