Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SDK17 timestamp issue: clean time auto

Hi,

  I use the timestamp log in SDK17,  and I find the time will auto clean at about 1min6-7sec.

   

Below is the code init the log.

/******************************************************************/

#define USE_CYCCNT_TIMESTAMP_FOR_LOG  1   // 0


uint32_t cyccnt_get(void)
{
return DWT->CYCCNT;
}


void timerstamp_log_init(void)
{
ret_code_t ret;
if (USE_CYCCNT_TIMESTAMP_FOR_LOG)
{
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
DWT->CYCCNT = 0;
APP_ERROR_CHECK(NRF_LOG_INIT(cyccnt_get, 64000000));
}
else
{
APP_ERROR_CHECK(NRF_LOG_INIT(app_timer_cnt_get));
}
NRF_LOG_DEFAULT_BACKENDS_INIT();
ret = nrf_drv_clock_init();
APP_ERROR_CHECK(ret);
nrf_drv_clock_lfclk_request(NULL);
}

/*********************************************************/

What's the reason of it?  How to fix it?

Could you please give a help?

Thank you very much!

Parents Reply Children
No Data
Related