This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

dfu via ota

Hi all,

I'am doing DFU via OTA 

The device will be in bootloader mode ?

my current application has a thread running when i'am initiating DFU via OTA in nrf_connect app,

the DFU process will start and complete but thread will be running simultaneously how can i stop my current application

from running while DFU via OTA process is going on

Regards

Tushar

Parents
  • HI Tushar,

    Which SDK are you using? After looking at some of your former threads, I will assume you use the nRF Connect SDK for now. 

    the DFU process will start and complete but thread will be running simultaneously how can i stop my current application

    This is normal. MCUboot, which is the bootloader used in the nRF Connect SDK, does not have BLE transport, so the transport happens in the application, which then includes the management subsystem. So your application will run during the DFU process, up to the point of activation, where a reset happens.

    If you want to do something in your application (like stop doing what it does, cleanup or something else), you can register relevant callbacks with img_mgmt_register_callbacks() or img_mgmt_set_upload_cb().

    Einar

  • Hi Einar Thorsrud,

    i have one more issue

    while doing dfu via ota with device manager app it gives me Mcu Mgr Error:NO_MEMORY(2)

    Regards

    Tushar

  • Hi Tushar,

    Good to hear the issue was resolved. The dfu_stopped_cb callback is called whenever img_mgmt_dfu_stopped() is called in img_mgmt.c, which is when something goes wrong during the transfer (see code for details).

  • Hi Einar Thorsrud,

    I looked into img_mgmt_dfu_stopped() function, but my doubt is how can i voluntarily get that dfu_stooped_cb() call back 

    i tried disconnecting while dfu process is going on, but it did not execute dfu_stopped_cb()

    and even dfu_pending_cb () is  not called while dfu process is going on

    I'am using nrf_connect_app for OTA

    Regards

    Tushar

  • Hi Tushar,

    In which situations is it you want an event? Any form of stopping the DFU process without success? Or something else?

  • Hi Einar Thorsrud,

    I'am actually running a thread so when i get callback dfu_started_cb() i suspend the thread, but when i disconnect the ble while dfu process is going on i want a callback saying dfu process is stopped, so that i can resume the thread,how can i get it

    Regards

    Tushar

  • Hi Tushar,

    I see. I do not believe there are any events for that out of the box. Perhaps you could check for an event indicating BLE disconnected (by specifying a callback for that with the call to bt_conn_cb_register()). If you first got an event from img_mgmt about DFU started, and then get a disconnect you will know that it has ended for some reason (at least provided you only have one BLE connection at a time).

Reply
  • Hi Tushar,

    I see. I do not believe there are any events for that out of the box. Perhaps you could check for an event indicating BLE disconnected (by specifying a callback for that with the call to bt_conn_cb_register()). If you first got an event from img_mgmt about DFU started, and then get a disconnect you will know that it has ended for some reason (at least provided you only have one BLE connection at a time).

Children
Related