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 Einar Thorsrud,

    I solved the issue as i was uploading different file and thank you

    I used this img_mgmt_register_callbacks() function and when i upload bin file via OTA it indicates dfu started but when will i get dfu stopped, while dfu process is going on i disconnected ble,but it was not indicating dfu stopped, how can i get dfu stopped.

    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

Reply
  • 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

Children
  • 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).

  • Hi Einar Thorsrud,

    We discussed previously about MCu Mgr Eroor:NO_MEMORY when i get this error ,dfu_stopped_cb() callback gets invoked.

    I solved the enabling of thread when ble disconnect by your above suggestion

    when i start dfu process it dfu_started_cb() gets invoked ,but when i cancel dfu process and start it again it resumes from the previous position and i dont get dfu_started_cb() callback.

    Does it mean that only once the callback will be given ?

    Regards

    Tushar

  • Hi Tushar,

    Yes, I do not see any other callbacks that can be used from img_mgmnt. If you need more I suspect you need to modify it to call another callback in other situations or regularily whenever data is received or something else, depending on what fits your use case.

  • Hi Einar Thorsrud,

    Thank you for your assitance

    Regards

    Tushar

Related