This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
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

After DFU Application at DFU_BANK_0_REGION_START is not valid

Hi,

I have a device with nRF52832 and firmware is composed of Bootloader (BL), softdevice (SD) S132 v2.0.0, application and I am using SDK 11.0.

I have created different firmware updates (BL, SD, App, BL+SD, etc.) in ZIP format (using nrfutil v2.2.0) and when I try to perform a DFU over BLE, I always end up with DFU_BANK_0_REGION_START (Addr: 0x0001C000) with all its content reset to 0xFFFFFFFF.

I use the application setting provided by Nordic support for nRF52 and I merge it together with the other HEX included in the ZIP files:

:020000040007F3    
:10F000000100000000000000FE000000FFFFFFFF05
:00000001FF

I have tried using the ZIP files provided in the SDK 11.0 in the example projects related to DFU usage, but even those fail. With the only difference that with those example ZIP files, actually the files get transferred (using Android app nRF Connect).

This is a sequence of events happening in my system when I try to perform a DFU (I have printed some log messages):

ble_evt_dispatch(): p_ble_evt->header.evt_id 16         -> BLE_GAP_EVT_CONNECTED
ble_evt_dispatch(): p_ble_evt->header.evt_id 18         -> BLE_GAP_EVT_CONN_PARAM_UPDATE
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE     
ble_evt_dispatch(): p_ble_evt->header.evt_id 81         -> BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE
bootloader_dfu_update_process() update_status = 4       -> DFU_BANK_0_ERASED
ble_evt_dispatch(): p_ble_evt->header.evt_id 1          -> BLE_EVT_TX_COMPLETE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 81         -> BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 80         -> BLE_GATTS_EVT_WRITE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 81         -> BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
ble_evt_dispatch(): p_ble_evt->header.evt_id 1          -> BLE_EVT_TX_COMPLETE
ble_evt_dispatch(): p_ble_evt->header.evt_id 1          -> BLE_EVT_TX_COMPLETE 
ble_evt_dispatch(): p_ble_evt->header.evt_id 81         -> BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
bootloader_dfu_update_process() update_status = 6       -> DFU_RESET
bootloader_app_is_valid(): EMPTY_FLASH_MASK

Resetting
[After restarting] 

bootloader_app_is_valid(): Application at DFU_BANK_0_REGION_START is not valid!

Do you have any suggestions on how to make it work. I am pretty sure it is just a matter of creating the proper ZIP file and/or incompatibility of SDK/DFU Manager/Android App.

Thank you for the support.

Marco

  • Hi Marco,

    If you're using the bootloader from SDK v11.0.0, i.e. Legacy Bootloader, then you have to use nrfutil v0.5.2, which can be downloaded here.

    If you want to flash a combined SoftDevice, Bootloader and Application hex file created with mergehex, where the device jumps to the application without having to perform a OTA update, you have to set the BANK_VALID_APP flag in bootloader_settings.c, i.e. change the line

    uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used));   
    

    to the following

    uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used)) = {BANK_VALID_APP};
    

    Please note that this modification must be removed if you plan to update the bootloader.

    -Bjørn

  • I am going to check it now.

    However, could you please clarify your very last line? You said that the modification must be removed if I want to update the bootloader. but few lines above you said

    If you want to flash a combined SoftDevice, Bootloader and Application

    Thank you very much, Marco

  • I tried your suggestions and this is the LOG:

    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 81
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    dfu_transport_ble.c: start_data_process()
    bootloader_dfu_update_process() update_status = 4
    ble_evt_dispatch(): p_ble_evt->header.evt_id 1
    ble_evt_dispatch(): p_ble_evt->header.evt_id 81
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 80
    ble_evt_dispatch(): p_ble_evt->header.evt_id 81
    dfu_init_pkt_complete START (state = 4): data received 0 B
    dfu_init_pkt_complete END (state = 5): data received 0 B
    Error 0x00003002 at line 619 in file sdk/components/libraries/bootloader_dfu/dfu_transport_ble.c
    DFU_BANK_0_REGION_START= 0x0001C000     DFU_BANK_1_REGION_START= 0x0004A000
    EMPTY_FLASH_MASK
    

    Error 0x3002 is #define BLE_ERROR_INVALID_CONN_HANDLE

  • @arjos85(Marco): Flashing and updating are two different things. What I meant was if you want to create a SD+BL image for OTA DFU, then you have to set m_boot_settingsto its default configuration, i.e.

    uint8_t  m_boot_settings[CODE_PAGE_SIZE]    __attribute__((at(BOOTLOADER_SETTINGS_ADDRESS))) __attribute__((used));
    

    and then recompile the project to create the hex for the image. Otherwise you will include an entire empty flash page in the image and you will get an error that the image is to large.

  • Thank you for the clarification, I see now the misunderstanding. I have customised my bootloader, and I am not going to update it with a newer version for the moment.

    So, the problem is that I want my firmware to be able to perform OTA for future updates. But so far I haven't succeeded. Do you have any suggestions?

    Thank you

Related