I try to set up a timer:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
static const nrfx_timer_t m_timer = NRFX_TIMER_INSTANCE(0);
void timer_handler(nrf_timer_event_t event_type, void *p_context) {
}
void timer_init(void) {
nrfx_timer_config_t timer_cfg = NRFX_TIMER_DEFAULT_CONFIG;
timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
ret_code_t err = nrfx_timer_init(&m_timer, &timer_cfg, timer_handler);
APP_ERROR_CHECK(err);
uint32_t ticks = nrfx_timer_ms_to_ticks(&m_timer, 1000);
nrfx_timer_extended_compare(&m_timer, NRF_TIMER_CC_CHANNEL0, ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
nrfx_timer_enable(&m_timer);
}
The nrfx_timer_init()
function crashes with an error:
Fullscreen
1
app_error_weak.c, 87, Application memory access: 228556:256
What is wrong? How to fix this?
Environment: nRF52840, NRF SDK 15.2, S140 6.1, Mesh SDK 2.2