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

DFU OTA does not work from application

I followed the instructions from here developer.nordicsemi.com/.../a00081.html to make my application support DFU OTA. Despite of some errors in the instructions I managed to finish the task, and got my application running. After connecting from a phone using nRFTools DFU feature, I can connect to my application, select the desired .zip file and then the DFU should start.

However, after a short connection UI just gives an error "disconnected". When I debugged the target device, it seems that the bootloader is started as expected but then it simply jams into its event loop (being busy there).

This is my third day on this and I would be very happy if somebody could help me.

EDIT: Below is my current "dirty hack" solution for the problem. I do not mark it as an answer, because it does not solve the problem cleanly. The modification is at the bootloader's main.c, and it makes the bootloader to reset after it first enters from application, and only after that, it enters the actual bootloader code. However, two upload tries is now needed from nRFTools, so the solution is not optimal.

bool app_reset = (NRF_POWER->GPREGRET == BOOTLOADER_DFU_START);
bool app_reset2 = (NRF_POWER->GPREGRET == ~BOOTLOADER_DFU_START);

if (app_reset)
{
    NRF_POWER->GPREGRET = ~BOOTLOADER_DFU_START;
    NVIC_SystemReset();
}
else if (app_reset2)
{
    NRF_POWER->GPREGRET = 0;
}

In addition, few other changes are needed to support "app_reset2" (several places at main). At least it works now somehow. But it is really a dirty hack as I said.

Parents Reply Children
No Data
Related