This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf_cal_get_time_string gives random values

Hello,

           i am using nrf52832  dev kit want to send the nrf calendar parameter  through nrf connect app and send through app successfully by taking uint8_t datatype .I have receive the data in void _write_handler(uint16_t conn_handle, ble_tlog_t * p_lbs, ble_gatts_evt_write_t * p_evt_write) function and nrf_cal_set_time(device_time_setting.manual_year,
device_time_setting.manual_month,device_time_setting.manual_day,device_time_setting.manual_hour,device_time_setting.manual_minute,device_time_setting.manual_second); all the parameter i.e day,month ,year are in uint8_t datatype when i print the value of  year,month,day,minute,second,hour then it print the exact value which i have send through nrfconnect app .when i check by printing  through NRF_LOG_INFO("%s",nrf_cal_get_time_string(true)); then it shows random value.

For eg:nrf_cal_set_time(8,3,21,14,12,45)  parametrs(month,day,year,hour,minute,second)

           nrf_cal_get_time_string(9,3,74,12,18,34).

Here RTC is used as  RTC2 in sdk configuration with 32768 frequency.

In general nrf_cal_get_time_string give the proper value but manually i have been trying to set then it shows random value.

I have not getting the exact value through   nrf_cal_get_time_string when i entering the value through nrf_cal_set_time.

       

Related