2022-02-01 12:11 PM
I have tried the following on my DK2 dev board:
I have verified that the RTC is using the LSE clock, and that the RTC is working by powering system off for a bit and seeing that the RTC doesn't lose time.
Thanks,
Ben Beckwith
Solved! Go to Solution.
2022-02-01 11:31 PM
Hi,
did you have setup the RTC TAMPALARM as push-pull output on PC13 (RTC_OUT1)?
Using such as following sequence (assuming other settings as default):
Please refer to Reference Manual RTC section for details.
Regards.
2022-02-01 11:31 PM
Hi,
did you have setup the RTC TAMPALARM as push-pull output on PC13 (RTC_OUT1)?
Using such as following sequence (assuming other settings as default):
Please refer to Reference Manual RTC section for details.
Regards.
2022-02-21 10:27 AM
Partrick,
Thanks for your reply. Is there any linux utility to set RTC_CR.OSEL = 0b11?
Cheers,
Ben
2022-02-22 06:47 AM
Hi,
I'm not SW expert, but I think those specific settings belongs to TF-A (either during boot phase or during shutdown sequence). so TF-A need to be adapted.
On Linux, maybe possible to do some trials with devmem2 (apt-get install devmem2), if RTC access is not forbidden by security settings.
Note that with devmem2 you might need to play also with peripheral bus clock enable in RCC registers before accessing a peripheral.
Anyway, sound like on starter package on DK2 board that RTC is not secured and its bus clock is already enabled.
So, something like this might do the job for just a trial (Tested on a DK2 with a battery):
# unlock RTC access
devmem2 0x5C004024 w 0xCA
devmem2 0x5C004024 w 0x53
# OSEL=0b11, WUTE=0, WUCKSEL=0b11
devmem2 0x5C004018 w 0x00600004
# Clear WUTF
devmem2 0x5C00405C w 0x00000004
# WUTR=60
devmem2 0x5C004014 w 0x0000003C
# WUTE=1
devmem2 0x5C004018 w 0x00600404
after first wake, need to clear flag before next shutdown.
# unlock RTC access
devmem2 0x5C004024 w 0xCA
devmem2 0x5C004024 w 0x53
# Clear WUTF
devmem2 0x5C00405C w 0x00000004
But I remind this is only for trial as devmem2 is not a clean solution and might have side effects with other RTC usage by the system.
Regards