cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 RTC in both M7 and M4 Dual Cores

YSN
Senior

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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
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".

View solution in original post

3 REPLIES 3
TDK
Guru

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".

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 ?

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".