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

  • I have done additional test and I can provide the following additional log:

    on_dfu_evt(): BLE_DFU_RECEIVE_INIT_DATA
    dfu_init_pkt_complete(): state = 4, m_init_packet_length 116
    dfu_init_pkt_complete(): next dfu state DFU_STATE_RX_DATA_PKT
    ble_dfu_response_send(): calling sd_ble_gatts_hvx (p_dfu->conn_handle = 0x9CBF)
    ble_dfu_response_send(): 0x3002
    

    I am using nRFConnect app to connect to nRF52 while in DFU and to transfer the ZIP file(s). It does not seem to lose connection while performing the DFU. However, I always get error 0x3002 (BLE_ERROR_INVALID_CONN_HANDLE).

  • Followup: On BLE_GAP_EVT_CONNECTED I get

    intern_softdevice_events_execute(): evt.gap_evt.conn_handle = 0x0000
    

    sd_ble_evt_get() returns an event with a connection handle (0x0000) different from BLE_CONN_HANDLE_INVALID (0xFFFF).

  • This is my very last test log:

    ble_evt_dispatch(): p_ble_evt->header.evt_id 81
    ble_conn_params_on_ble_evt(): default
    ble_dfu_on_ble_evt(): BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
    on_dfu_evt(): Start
    on_dfu_evt(): BLE_DFU_RECEIVE_INIT_DATA
    dfu_init_pkt_complete(): state = 4, m_init_packet_length 116
    dfu_init_pkt_complete(): next dfu state DFU_STATE_RX_DATA_PKT 
    ble_dfu_response_send(): Start here...
    ble_dfu_response_send(): calling sd_ble_gatts_hvx (p_dfu->conn_handle 0x4AF8): **m_conn_handle 0x0000**
    ble_dfu_response_send(): err_code 0x00003002
    

    In file ble_conn_param.c I have declared:

    uint16_t               m_conn_handle;
    

    And in file ble_dfu.c

    extern uint16_t m_conn_handle;
    

    The log shows that m_conn_handle is still valid (0x0000) just before calling function sd_ble_gatts_hvx().

  • Is this the standard bootloader from SDK v11.0.0 or is one that you have made yourself/modified?

  • This is the version we have customised. But the DFU was working till our previous version of hardware. In the new version we have moved from the nRF52832-QFAA to the nRF52832-CIAA. But I guess this should not make any difference. I will dig in the changes in our code to see what could cause this issue. But it is weird, because the error seem to be returned by the SD (original).

Related