i have recently upgraded to SDK 15.2, and since doing so I am struggling to get timestamps working in the logger.
I am initialising the logger here:
Fullscreen
1
2
3
4
//Start microsecond timer:
us_timer_config();
ret_code_t err_code = NRF_LOG_INIT(time_us);
APP_ERROR_CHECK(err_code);
And here is my microsecond timer.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "velo_us_timer.h"
//
const nrf_drv_timer_t us_timer = NRF_DRV_TIMER_INSTANCE(1);
void us_timer_config(void)
{
uint32_t err_code=NRF_SUCCESS;
nrf_drv_timer_config_t timer_cfg =
{
.frequency = NRF_TIMER_FREQ_1MHz, //Sets prescaler to get a counter increment at 1MHz.
.mode = NRF_TIMER_MODE_TIMER, // in this mode counter increments by 1 on each clock cycle (clock x prescaler actually)
.bit_width = NRF_TIMER_BIT_WIDTH_32,
.interrupt_priority = TIMER_DEFAULT_CONFIG_IRQ_PRIORITY,
.p_context = NULL
};
err_code=nrf_drv_timer_init(&us_timer,&timer_cfg,us_timer_event_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_timer_enable(&us_timer);
}
When I log (using NRF_LOG_INFO("comment")) no timestamp appears. This code worked in SDK 14.2 . Any ideas what I'm misssing? Thank you.