2022-12-20 07:31 PM
Hi,
I am using RTC with LSE (32.768Khz) in my product, and I programed RTC wakeup timer to 5min by calling
HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 300, RTC_WAKEUPCLOCK_CK_SPRE_16BITS);
It works perfectly on my test machine, but it will not trigger on my customer side with identical firmware.
I have checked the return value from HAL_RTCEx_GetWakeUpTimer() is 300 for sure.
Is there any reason make RTC stop counting this timer or stop this feature?
Thanks,
-Engin
2022-12-22 03:16 AM
Hi @Engin Lee,
is the LSE working well ? I'd try to use the MCO1 output to check if the LSE is clocking correctly. There may be a problem with the oscillator or it's connection, even possibly some EMC problem.
BR,
J
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.
2022-12-22 06:37 PM
Hi @JHOUD ,
I appreciate for your suggestion, and I am guessing it's an issue from oscillator too.
But I can't confirm it until receiving failure machine from customer side.
At meanwhile, I will study AN4736 in order to detect LSE is working or not by using TIM16 remap mode and counting pulses during 1 second.
Maybe it's a good choice to switch RTC clock source to LSI (32kHz) when LSE is abnormal?
Thanks,
-Engin
2022-12-23 01:48 AM
Hi @Engin Lee,
if you are in position to send a new FW to the customer, try increasing the LSE oscillator driving capability in RCC_BDCR->LSEDRV. Default is low, to conserve power and most of the time sufficient. In noisy environments or with less than ideal crystal, the driving capability increase often helps. In the same register you can also configure CSS on LSE, please read chapter 8.5.3 of the RM0433 carefully, it's not just matter of setting a register flag and forgetting.
Good luck!
J
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.
2022-12-29 06:45 PM
Could be caused by this:
And ST's code doesn't show how to put STM32 into low-power modes properly either: