nRF 52 DK Clock way too fast

Hello! I'm trying to setup the internal clock on an nRF 52 DK using the nRF Connect SDK. The clock is able to be set "correctly" (date_time_set returns 0) and the time does set to the right values initially. But, the clock is moving WAY too fast. It's going through an hour of 'clock time' in under a second.

For my KCONFIG I have turned on the following options:

CONFIG_DATE_TIME=y
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y

My code looks something like this:

struct tm temp_time = {
    .tm_hour = 8,
    .tm_isdst = 1,
    .tm_mday = 21,
    .tm_min = 0,
    .tm_mon = 11,
    .tm_sec = 0,
    .tm_year = 123,
};

int err = date_time_set(&temp_time);
time_t cur_time = 0;
while(1) {
    err = date_time_now(&cur_time);
    if (0 == err) {
        struct tm *local_time = localtime(&cur_time);
        printk("tm_wday: %d\n", local_time->tm_wday);
        printk("tm_hour: %d\n", local_time->tm_hour);
        printk("tm_min: %d\n", local_time->tm_min);
    }
    k_sleep(K_SECONDS(1));
}

The output of my console looks like:

00> tm_wday: 1
00> tm_hour: 8
00> tm_min: 0
00> tm_wday: 1
00> tm_hour: 10
00> tm_min: 30
00> tm_wday: 1
00> tm_hour: 10
00> tm_min: 46
00> tm_wday: 1
00> tm_hour: 11
00> tm_min: 3
00> tm_wday: 1
00> tm_hour: 11
00> tm_min: 20
00> tm_wday: 1
00> tm_hour: 11
00> tm_min: 36
00> tm_wday: 1
00> tm_hour: 11
00> tm_min: 53
00> tm_wday: 1
00> tm_hour: 12
00> tm_min: 10
00> tm_wday: 1
00> tm_hour: 12
00> tm_min: 26
00> tm_wday: 1
00> tm_hour: 12
00> tm_min: 43
00> tm_wday: 1
00> tm_hour: 13

As you can see, the time starts at the right value, but ticks at a rate that much faster than expected. Is there some K_CONFIG option or init call I'm missing?

Thank you,

Corey

Parents Reply Children
No Data
Related