Skip to main content
Param sivan
Associate III
Jul 7, 2020 5:39 PM UTC
Question

HAL_RTC_GetTime - Problem for increment the count according to seconds

Hi,

In one of my task, i just increment a one seconds counter variable after read HAL_RTC_GetTime  and compare the read seconds value is change or not. It doesn't work until I comment the following line in the HAL_RTC_GetTime  function as described in one thread in the forum. What is the cause? How do I resolve this issue ? Thanks in advance.

sTime->SubSeconds = (uint32_t)(hrtc->Instance->SSR);

Thanks,

Param.

This topic has been closed for replies.

3 replies

Piranha
Principal III
Jul 7, 2020 5:47 PM UTC
waclawek.jan
Super User
Jul 8, 2020 5:16 AM UTC

As Piranha said above: read date after reading time, or set RTC->CR.BYPSHAD.

JW

Param sivan
Associate III
Jul 28, 2020 3:41 PM UTC

Thank you. It solved my issue.