Skip to main content
KPrzy.1
Associate II
Jun 9, 2021 9:13 AM UTC
Question

HAL_RTCEx_GetTimeStamp

why  sTimeStampDate->Year = 0U; variable is cleared when time stamp is read?

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
Jun 9, 2021 1:53 PM UTC

Which STM32?

RTC_TSDR does not have a field for Year, whereas the structure used as type for sTimeStampDate is a common structure for all RTC dates, i.e. it does contain year, so this is a way to initialize it to some definite value.

JW

KPrzy.1
KPrzy.1Author
Associate II
Jun 17, 2021 7:58 AM UTC

stm32f411re, it looks like there is no year for the timestamp register, checked with ds and rm