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

SDfile, Bootloadera and Application Files updating using Serial DFU bootloader

Hi All,

We are using NRF52832 in our project. We have implemented the c code to perform nrfutil operations.

We are following below steps to do it.

  1. Erase all files. Upload SD file and Bootloader files from the nrfGo studio.
  2. Combine SDfile, Bootloadera and Application bin files into one file with same order.
  3. Put NRF52832 into DFU mode. 
  4. Send combined file data from st micro controller to NRF52832 using UART.
  5. Once all data sent. Reset the NRF52832 and checked the known FW version.
  6. All are working fine.

But if i try to update file one more time, NRF52832 is accepting SD file and boot loader init file after that its not accepting the data.

To avoid this issue we need to erase all data from the NRF52832 and upload the data.

How to update files without erasing previous data?

Is our procedure is wrong?

Is there any order for files update? like which file should go first and others.

Thanks and regards,

Basavanagouda.

Parents
  • Hi Basava,

    Assuming you are using the secure uart serial bootloader in sdk v15.2, take a look at this function inside the nrf_dfu_ver_validation.c file:

    // This function assumes p_init->has_fw_version.
    static bool fw_version_ok(dfu_init_command_t const * p_init)
    {
        ASSERT(p_init != NULL);
        ASSERT(p_init->has_fw_version);
    
        if (  (p_init->type == DFU_FW_TYPE_APPLICATION)
           || (p_init->type == DFU_FW_TYPE_SOFTDEVICE))
        {
            return ((p_init->fw_version >= s_dfu_settings.app_version) || !NRF_DFU_APP_DOWNGRADE_PREVENTION);
        }
        else
        {
            return  (p_init->fw_version > s_dfu_settings.bootloader_version);
        }
    }

    If you change:

    return  (p_init->fw_version > s_dfu_settings.bootloader_version);

    to:

    return  (p_init->fw_version >= s_dfu_settings.bootloader_version);

    I am pretty sure it should work if you still have the same bootloader version as before.

Reply
  • Hi Basava,

    Assuming you are using the secure uart serial bootloader in sdk v15.2, take a look at this function inside the nrf_dfu_ver_validation.c file:

    // This function assumes p_init->has_fw_version.
    static bool fw_version_ok(dfu_init_command_t const * p_init)
    {
        ASSERT(p_init != NULL);
        ASSERT(p_init->has_fw_version);
    
        if (  (p_init->type == DFU_FW_TYPE_APPLICATION)
           || (p_init->type == DFU_FW_TYPE_SOFTDEVICE))
        {
            return ((p_init->fw_version >= s_dfu_settings.app_version) || !NRF_DFU_APP_DOWNGRADE_PREVENTION);
        }
        else
        {
            return  (p_init->fw_version > s_dfu_settings.bootloader_version);
        }
    }

    If you change:

    return  (p_init->fw_version > s_dfu_settings.bootloader_version);

    to:

    return  (p_init->fw_version >= s_dfu_settings.bootloader_version);

    I am pretty sure it should work if you still have the same bootloader version as before.

Children
No Data
Related