Description
Embedded devices tend to run for a long time once deployed.
Currently there are several places in RIOT where mktime() / time_t is used. This will break on 2038-01-19.
Linux solved this by using 64 bit timestamps. I don't think this can be a general solution for RIOT as a mayor use case is using the result of mktime() to configure a 1 Hz RTT as RTC where the counter register is only 32 bit.
Since RTC is unlikely to be set to the past, we could use a custom offset ('RIOT epoch') or implement a custom version/wrapper for mktime() that returns unsigned values.
affected RTC implementations
Useful links
Description
Embedded devices tend to run for a long time once deployed.
Currently there are several places in RIOT where
mktime()/time_tis used. This will break on 2038-01-19.Linux solved this by using 64 bit timestamps. I don't think this can be a general solution for RIOT as a mayor use case is using the result of
mktime()to configure a 1 Hz RTT as RTC where the counter register is only 32 bit.Since RTC is unlikely to be set to the past, we could use a custom offset ('RIOT epoch') or implement a custom version/wrapper for
mktime()that returnsunsignedvalues.affected RTC implementations
esp32fe310kinetisstm32f1Useful links