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

Setting up APP_TIMER results in hardware fault

I started with the ble_app_template example. This example uses the Button event and notifies it. I modified the project to send some other data as notification, instead of the button state. And for the data to be read an transmitted, I initialized a timer. My timer_init looks like this,

static void timers_init(void)
{
	uint32_t err_code;
    // Initialize timer module, making it use the scheduler
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS,     APP_TIMER_OP_QUEUE_SIZE, true);
	
	err_code = app_timer_create(&m_ldc_timer_id,
                                APP_TIMER_MODE_REPEATED,
                                data_timeout_handler);
    APP_ERROR_CHECK(err_code);
}

where data_time_handler is the event handler for the timer.

My timer_start looks like this:

static void timers_start(void)
{
	  uint32_t err_code = app_timer_start(m_timer_id, HEART_RATE_MEAS_INTERVAL, NULL);
    APP_ERROR_CHECK(err_code);
}

Why would I be going in to a hard fault ?

Related