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

Help with buttonless DFU

Hello!

nRF52832, SDK15, SES

I'm working on a project where DFU is activated by receiving a command from the app. I took ble_app_buttonless_dfu as reference. 

For starters, I will first explain what i added to my project.

Functions:

    -app_shutdown_handler()

    -NRF_PWR_MGMT_HANDLER_REGISTER

    -buttonless_dfu_sdh_state_observer()

    -NRF_SDH_STATE_OBSERVER

    -ble_dfu_evt_handler()

In the services_init() i added

   -ble_dfu_buttonless_init_t dfus_init = {0};
    // Initialize the async SVCI interface to bootloader.
    err_code = ble_dfu_buttonless_async_svci_init();
    APP_ERROR_CHECK(err_code);

    dfus_init.evt_handler = ble_dfu_evt_handler;

    err_code = ble_dfu_buttonless_init(&dfus_init);
    APP_ERROR_CHECK(err_code);

What I thought to do is to force a call on ble_dfu_buttonless_on_ble_evt, something like this:

if(p_evt_write->data[0] == 0x01)
{
       //START DFU
       ble_dfu_buttonless_on_ble_evt(BLE_GATTS_EVT_HVC, NULL);
}

But i'm sure that's not how it's supposed to be done. Can i get some guidance about this? (I have already check Getting started with Nordic's Secure DFU bootloader, a step by step guide and they use an older SDK)

Parents
  • I figured it out. I will explain what i did if someone else get the same issue.

    First of all i added my code to the buttonless DFU example as Giang suggested. 

    Then my mistake was to think that pressing the DFU button on nRF connect was gonna do all the job and the app was trying to upload the new version not in the secure_bootloader. So i had to go the services in my application and restore to bootloader there and connect to DFUTarg again and upload the new version of my application.

    I guess the app i make for the phone will have to do all that in the background.

Reply
  • I figured it out. I will explain what i did if someone else get the same issue.

    First of all i added my code to the buttonless DFU example as Giang suggested. 

    Then my mistake was to think that pressing the DFU button on nRF connect was gonna do all the job and the app was trying to upload the new version not in the secure_bootloader. So i had to go the services in my application and restore to bootloader there and connect to DFUTarg again and upload the new version of my application.

    I guess the app i make for the phone will have to do all that in the background.

Children
No Data
Related