Skip to main content
Associate
Sep 2, 2025 1:53 AM UTC
Question

STM32WBA52 RTC Stop

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;
}
}

This topic has been closed for replies.

6 replies

ST Employee
Sep 3, 2025 12:19 PM UTC

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
Sep 11, 2025 12:39 PM UTC

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
Sep 11, 2025 1:11 PM UTC

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
ST Technical Moderator
Sep 19, 2025 3:57 PM UTC

Hello @userwba52etc 

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

Best Regards.

STTwo-32

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.
Associate
Sep 24, 2025 7:19 AM UTC

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.