Hi,
I am unable to find the DFU services in example ble_app_buttonless_dfu provided in SDK 17.
Please suggest how to proceed.
Thanks
Raj
Hi,
I am unable to find the DFU services in example ble_app_buttonless_dfu provided in SDK 17.
Please suggest how to proceed.
Thanks
Raj
Hi Einar,
Here is the RTT log given below when i am trying to perform DFU with ESP32 device, Please have a look and suggest what is wrong ?
<info> app: Inside main
<debug> app: In nrf_bootloader_init
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> nrf_dfu_settings: Using settings page.
<debug> nrf_dfu_settings: Copying forbidden parts from backup page.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<debug> app: Enter nrf_bootloader_fw_activate
<info> app: No firmware to activate.
<debug> app: App is valid
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<debug> app: Running nrf_bootloader_app_start with address: 0x00001000
<debug> app: Disabling interrupts. NVIC->ICER[0]: 0x0
<info> app: Inside main
<debug> app: In nrf_bootloader_init
<debug> nrf_dfu_settings: Calling nrf_dfu_settings_init()...
<debug> nrf_dfu_flash: Initializing nrf_fstorage_nvmc backend.
<debug> nrf_dfu_settings: Using settings page.
<debug> nrf_dfu_settings: Copying forbidden parts from backup page.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<info> nrf_dfu_settings: Backing up settings page to address 0xFE000.
<debug> nrf_dfu_settings: Destination settings are identical to source, write not needed. Skipping.
<debug> app: Enter nrf_bootloader_fw_activate
<info> app: No firmware to activate.
<debug> app: App is valid
<debug> app: DFU mode requested via GPREGRET.
<info> nrf_bootloader_wdt: WDT is not enabled
<debug> app: in weak nrf_dfu_init_user
<debug> app: timer_stop (0x20005984)
<debug> app: timer_activate (0x20005984)
<info> app: Entering DFU mode.
<debug> app: Initializing transports (found: 1)
<debug> nrf_dfu_ble: Initializing BLE DFU transport
<debug> nrf_dfu_ble: Setting up vector table: 0x000F1000
<debug> nrf_dfu_ble: Enabling SoftDevice.
<debug> nrf_dfu_ble: Configuring BLE stack.
<debug> nrf_dfu_ble: Enabling the BLE stack.
<debug> nrf_dfu_ble: No advertising name found
<debug> nrf_dfu_ble: Using default advertising name
<debug> nrf_dfu_ble: Advertising...
<debug> nrf_dfu_ble: BLE DFU transport initialized.
<debug> nrf_dfu_flash: Initializing nrf_fstorage_sd backend.
<debug> app: Enter main loop
<debug> nrf_dfu_ble: Connected
<debug> nrf_dfu_ble: Received BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST (request: 256, reply: 247).
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_CONN_PARAM_UPDATE
<debug> nrf_dfu_ble: max_conn_interval: 12
<debug> nrf_dfu_ble: min_conn_interval: 12
<debug> nrf_dfu_ble: slave_latency: 0
<debug> nrf_dfu_ble: conn_sup_timeout: 51
<debug> nrf_dfu_ble: Received BLE_GAP_EVT_CONN_PARAM_UPDATE
<debug> nrf_dfu_ble: max_conn_interval: 120
<debug> nrf_dfu_ble: min_conn_interval: 120
<debug> nrf_dfu_ble: slave_latency: 0
<debug> nrf_dfu_ble: conn_sup_timeout: 60
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_SELECT:
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_SELECT (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> app: Shutting down transports (found: 1)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_CREATE:
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_CREATE (command)
<debug> app: timer_stop (0x20005984)
<debug> app: timer_activate (0x20005984)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 20 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_ble: Buffer 0x200092B8 acquired, len 4 (244)
<info> nrf_dfu_req_handler: NRF_DFU_OP_OBJECT_WRITE
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_WRITE (command)
<debug> nrf_dfu_ble: Freeing buffer 0x200092B8
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_CRC_GET (command)
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x1
<debug> nrf_dfu_req_handler: Handle NRF_DFU_OP_OBJECT_EXECUTE (command)
<debug> nrf_dfu_validation: PB: Init packet data len: 67
<error> nrf_dfu_validation: Handler: Invalid protocol buffer m_pb_stream
<error> nrf_dfu_validation: Failed to decode init packet
<debug> nrf_dfu_req_handler: Request handling complete. Result: 0x5
<warning> nrf_dfu_ble: DFU request 4 failed with error: 0x5
Hi,
The firs terror in the log is "<error> nrf_dfu_validation: Handler: Invalid protocol buffer m_pb_stream", which comes from stored_init_cmd_decode() in components\libraries\bootloader\dfu\nrf_dfu_validation.c. That means that the init packet is corrupt of some sort, as the protobuf decoding fails. So you must have done something wrong when transmitting the init packet.
Perhaps the simplest way to spot the error would be to log the data received in the bootloader (or observe with a sniffer), and compare what you get with your DFU master implementation and what you get with a working DFU master implementation upgrading with the same DFU zip file. Whatever the difference is should give a indication on what you did wrong.
Hi Einar,
Init packet is send successfully, Now I need to transfer my firmware packet to the DFU Target.
But when i send
Init Packet Send Process
DFU Controller ----------0x01-----------> DFU Target (AT DFU characteristics)
DFU Controller <----------0X20 0x01 0x01----------- DFU Target
DFU Controller ----------0x06 0x01-----------> DFU Target (AT Control characteristics)
DFU Controller <---------60 06 01 00 02 00 00 00 00 00 00 00 00 00 00------------ DFU Target
DFU Controller ----------01 01 90 00 00 00----------> DFU Target (AT Control characteristics)
DFU Controller <----------60 01 01---------- DFU Target
DFU Controller ----------Send init packet no response----------> DFU Target (AT data characteristics)
DFU Controller ----------0x03---------> DFU Target (AT Control characteristics)
DFU Controller <----------60 03 01 90 00 00 00 58 0b a5 3b---------- DFU Target
DFU Controller ----------0x04---------> DFU Target (AT Control characteristics)
DFU Controller <----------60 04 01---------- DFU Target
Firmware Packet Send Process
DFU Controller -----------06 02----------> DFU Target
DFU Controller <-----------60 06 01 00 10 00 00 00 00 00 00 00 00 00 00---------- DFU Target
According to the response of this (06 02) we can only create a data object of 4kb size ,But my firmware image is about 97 kb can u suggest how can I transmit the image to my DFU Target controller.
Thanks
Raj
Hi Raj,
You cannot send larger data objects than 4 kB, but that only means that you split the firmware in multiple objects and specify the offset for each one. See DFU protocol.
Hi Einar,
The link you provided is not working .
What do you mean by offset?
thanks
Raj