2025-09-01 6:53 PM
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;
}
}
2025-09-03 5:19 AM
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.
2025-09-11 5:39 AM
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.
2025-09-11 6:11 AM
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.
2025-09-18 10:20 PM
Hello,
When I checked the RCC register, the normal product was 8B and the defective product was 89.
LSEON is 1, but LSERDY is 0.
I confirmed that the same thing happens when creating a new project in Cube IDE and changing only the LSE settings.
I would like to have a failure analysis done through my distributor.
Thank you.
2025-09-19 8:57 AM
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.
2025-09-24 12:19 AM
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.