Hi,Team,
I'm currently using the nrf54l15-dk. I want to set the rtc of the nrf54l15-dk to obtain the timestamp. How should I configure the rtc? Which examples should I refer to?
My ncs version is v2.8.0.
Thanks.
Hi,Team,
I'm currently using the nrf54l15-dk. I want to set the rtc of the nrf54l15-dk to obtain the timestamp. How should I configure the rtc? Which examples should I refer to?
My ncs version is v2.8.0.
Thanks.
Hello,
You can use UNIX timestamp (using Date time+ k_uptme_get. UNIX timestamp requires that the data time library has obtained a valid time first (e.g., via data_time_update_async or data_time_set), then coverts uptime UNIX time. source: date_time group; date_time.h
In the prj.conf file you need to set the following config to enable GRTC SYSCOUNTER :
# Ensure GRTC SYSCOUNTER is started by the driver on boot (nRF54L15) CONFIG_NRF_GRTC_START_SYSCOUNTER=y
Now in the app code, you can follow the following steps:
a. Initializing Date Time library and setting valid time
An example code
int64_t uptime = k_uptime_get();
date_time_uptime_to_unix_time_ms(&uptime);
// At this point `uptime` contains the unix timestamp in milliseconds.