I am able to set RTC time using
// Ignore the values as they are for test purpose only
struct rtc_time sRtcTime;
sRtcTime.tm_year = 2030;
sRtcTime.tm_mon = 2;
sRtcTime.tm_mday = 10;
sRtcTime.tm_hour = 22;
sRtcTime.tm_min = 48;
sRtcTime.tm_sec = 20;
rtc_set_time(rtc_dev, &sRtcTime);
print of above dataset value:
[00:00:02.462,066] <inf> PWL: 22:48:20 3/10/3930 - 253069
However get RTC time
struct rtc_time time;
rtc_get_time(rtc_dev, time);
give me garbage
[00:00:07.970,794] <inf> PWL: Get Time
[00:00:07.975,006] <inf> PWL: 0:0:975720936 536983993/101255/203815 - 7959
i’ve added the following in my circuitdojo_feather_nrf9151_ns.overlay file:
&rtc0 {
status = "okay";
prescaler = <127>;
};
and updated the prj.conf file with:
# RTC
CONFIG_COUNTER=y
CONFIG_RTC=y
CONFIG_RTC_ALARM=y
CONFIG_RTC_UPDATE=y
Where did I go wrong…..