Skip to main content
Associate II
May 28, 2024
Question

STM32U585 RTC DST

HI

I use the STM32U585 with HAL

This is my setting for time :

_sTime.Minutes =_minute;
_sTime.Seconds =_seconde;
_sTime.TimeFormat =RTC_HOURFORMAT_24;
_sTime.DayLightSaving = RTC_DAYLIGHTSAVING_NONE; 
if (HAL_RTC_SetTime(&hrtc, &_sTime, RTC_FORMAT_BIN) != HAL_OK) 
{
Error_Handler();
}

And for read time :

HAL_RTC_GetTime(&hrtc, &stime, RTC_FORMAT_BIN);
second=stime.Seconds;
minute=stime.Minutes;
hour=stime.Hours;

When I read time, time is One houre later that SetTime. How to correct this (The DST is not necessary because the time is synchronised with PC time each hour)

Thanks

Marc

 

This topic has been closed for replies.