Skip to main content
KPrzy.1
Associate II
June 9, 2021
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
June 9, 2021

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
June 17, 2021

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