Skip to main content
YSN
Associate III
August 28, 2021
Solved

STM32H7 RTC in both M7 and M4 Dual Cores

  • August 28, 2021
  • 3 replies
  • 1405 views

I wanted to use RTC in both my cores M7 and M4. Is RTC a shared peripheral ? Can we use RTC to set or get time from any core asynchronously ?

Please share any configuration need to be done for doing so ?

This topic has been closed for replies.
Best answer by TDK
Reading from the RTC at the same time is not a problem. Writing a new time needs a mechanism to ensure only one core does it at a time, such as HSEM. Preventing reading invalid values while the time is being updated could also use such a mechanism if desired.

3 replies

TDK
August 28, 2021

Yes, it's shared, just like most (all?) of the other peripherals. You can access it from either core. Naturally, if you set it from one core, then set it from the other, you are overwriting the previous values.

RTC examples are in the CubeMX repository.

https://github.com/STMicroelectronics/STM32CubeH7/blob/ccb11556044540590ca6e45056e6b65cdca2deb2/Projects/STM32H7B3I-DK/Examples/RTC/RTC_Alarm/readme.txt

"If you feel a post has answered your question, please click ""Accept as Solution""."
YSN
YSNAuthor
Associate III
August 28, 2021

Fine, Overwriting is not a problem for me, but how about both cores accessing same RTC at same time, in such scenario should we use HSEM or is it already protected function ?

TDK
TDKBest answer
August 28, 2021
Reading from the RTC at the same time is not a problem. Writing a new time needs a mechanism to ensure only one core does it at a time, such as HSEM. Preventing reading invalid values while the time is being updated could also use such a mechanism if desired.
"If you feel a post has answered your question, please click ""Accept as Solution""."