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

Bringing the Bootloader into deep sleep

Hello,

I`m using more or less the Nordic OTA bootloader implementation. There is a timeout that forces the bootloader to reset, if no action happens. Because we have an battery supplied device, I want to bring the bootloader into deep sleep with the sd_power_system_off(); function in case of a timeout. Therefor I added some code to the bootloader_dfu_update_process(...) function:

else if (update_status.status_code == DFU_TIMEOUT)
{
    // Timeout has occurred. Close the connection with the DFU Controller.
    uint32_t err_code = dfu_transport_close();
    APP_ERROR_CHECK(err_code);

	dbg_printf("WD Timeout\r");
	NRF_TWI0->ENABLE = 0;
	gpio_config_default_all();
	nrf_delay_ms(4);
	app_timer_stop(m_dfu_timer_id);
	sd_power_system_off();
    m_update_status = BOOTLOADER_TIMEOUT;
}

But after the timeout, the device still draws ~4mA. For me, it seems that there is still a module running, that requires the CPU. But I don`t know which one it is... Has anybody an idea about that?

Regards, BTprogrammer

Related