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

DFU Update OTA of an application with ble secure bootloader works only once

Hi, I try to use the dfu update OTA with ble secure bootloader. If the Flash is erased and only the SD v5.0.0 and the own Bootloader are programmed a update OTA is working fine (using nrf Connect). After that, I tried to update the same APP.HEX file again and now the following error occurs:

[DFU] Remote DFU error: OPERATION FAILED

How can that be ???

Here my development environment:

GCC
NRF52
SDK14
SD5.0.0
Own ble_app_blinky (APP:HEX)
Own bootloader_secure_ble
Own private key

Thanks, Boris

Parents
  • Hi, here the zip with my files. Now I have a solution. I init the m_fs values (evt_handler, start_addr and end_addr) in the nrf_dfu_init_user function. Here the code in main.c :

    /* @BS*/
    #include "nrf_fstorage.h"
    #include "nrf_dfu_types.h"
    extern nrf_fstorage_t m_fs;
    extern void dfu_fstorage_evt_handler(nrf_fstorage_evt_t * p_evt);
    
    uint32_t nrf_dfu_init_user(void)/* call in bootloader.c */
    {
        NRF_LOG_DEBUG("nrf_dfu_init_user");
        /* fs_data init */
        m_fs.evt_handler   = dfu_fstorage_evt_handler;
        m_fs.start_addr     = MBR_SIZE;
        m_fs.end_addr       = BOOTLOADER_SETTINGS_ADDRESS + CODE_PAGE_SIZE;
    
        return NRF_SUCCESS;
    }
    
    /**@brief Function for application main entry. */
    int main(void)
    {
       :
       :
    }
    

    With this init it works fine. But I don't understand if it's only a workaround or a necessary init ??? Where are the 3 values init after a new start of the eval board. After the programing the values are set. but after a restart they are not set.

Reply
  • Hi, here the zip with my files. Now I have a solution. I init the m_fs values (evt_handler, start_addr and end_addr) in the nrf_dfu_init_user function. Here the code in main.c :

    /* @BS*/
    #include "nrf_fstorage.h"
    #include "nrf_dfu_types.h"
    extern nrf_fstorage_t m_fs;
    extern void dfu_fstorage_evt_handler(nrf_fstorage_evt_t * p_evt);
    
    uint32_t nrf_dfu_init_user(void)/* call in bootloader.c */
    {
        NRF_LOG_DEBUG("nrf_dfu_init_user");
        /* fs_data init */
        m_fs.evt_handler   = dfu_fstorage_evt_handler;
        m_fs.start_addr     = MBR_SIZE;
        m_fs.end_addr       = BOOTLOADER_SETTINGS_ADDRESS + CODE_PAGE_SIZE;
    
        return NRF_SUCCESS;
    }
    
    /**@brief Function for application main entry. */
    int main(void)
    {
       :
       :
    }
    

    With this init it works fine. But I don't understand if it's only a workaround or a necessary init ??? Where are the 3 values init after a new start of the eval board. After the programing the values are set. but after a restart they are not set.

Children
No Data
Related