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

HardFault_Handler when I use WDT

Hi,

I'm using SDK 13.1 and SD 4.0.5 and I add to my code the WDT example of the SDK, but the code doesn't work, and when I debug, the code is stucked in HardFault_Handler when arrives at app_sched_execute() in event_handler(p_event_data, event_data_size); line.

//my code
//Configure WDT.
nrf_drv_wdt_config_t config = NRF_DRV_WDT_DEAFULT_CONFIG;
err_code = nrf_drv_wdt_init(&config, wdt_event_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_wdt_channel_alloc(&m_channel_id);
APP_ERROR_CHECK(err_code);
nrf_drv_wdt_enable();

for(;;){
	nrf_drv_wdt_channel_feed(m_channel_id);
	app_sched_execute();
	//my code
}

Why the code gets stuck in HardFault_Handler? I have to define or modify something of app_sched to use wdt? If I don't use wdt the code executes correctly.

Related