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

bootloader activate and reset - won't reset

Hi, I'm using trying to use the DFU via BLE, dual bank example from SDK 8.1.1 (with SD 8.0.0) and got it all working up to the point where I call "activate image and reset".

At that point, it activates the image, which calls dfu_image_activate(). This succeeds, and then nothing happens: the reset is in an if statement: if (err_code != NRF_SUCCESS) (at dfu_transport_ble.c:591).

I tried changing that, so that dfu_reset() gets called anyway, then it gets to m_update_status = BOOTLOADER_RESET; (at bootloader.c:234), and that's it. It seems like the reset never happens, because it never gets handled, I guess it's stuck at sd_app_evt_wait() ?

Anyone knows how to fix this properly?

edit

Seems like it got stuck in app_sched_execute(), handling BLE_GAP_EVT_DISCONNECTED in dfu_transport_ble.c with error code 5 (NRF_ERROR_NOT_FOUND). It gets disconnected in dfu_transport_close (at dfu_transport_ble.c:1095).

Parents
  • Hi Bart,

    You should not edit the dfu_transport_ble.c to trigger system reset when err_code == NRF_SUCCESS. What we do inside dfu_image_activate() is to call m_functions.activate() which is equal to dfu_activate_app(). In this function we will actually do the flash swapping and updating the bootloader information.

    What the bootloader does after the dfu_image_activate() call is to wait for the PSTORAGE_STORE_OP_CODE event from the stack in pstorage_callback_handler() in bootloader.c telling the bootloader setting is saved (BOOTLOADER_COMPLETE) and return to main to switch to application (bootloader_app_start() ).

    If you test with our DFU example without any modification, would it work ? If not, what was the behaviour ?

  • Ah, sorry, at dfu_transport_ble.c:793. The handling of ble gap disconnect.

Reply Children
No Data
Related