I think clock_synchronize() is okay for startup initialization, but would be inappropriate at run time. That is because it could cause the current time to apparently jump backward. That could be fatal under certain circumstances as described for adjtime() in https://github.com/apache/nuttx/issues/8858NuttX offers a function clock_synchronize() that synchronizes system clock with clock from RTC (internal or external). The synchronization is done during board initialization and I suppose this can also be called from an application level if required.
- RTC synchronization with system time Michal Lenc
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time Michal Lenc
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time David S. Alessio
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time Nathan Hartman
- Re: RTC synchronization with system time Gregory Nutt
- Re: RTC synchronization with system time Tomek CEDRO
- Re: RTC synchronization with system time Gregory Nutt