Device Firmware Update#
Device Firmware Update.
These commands and events are related to controlling firmware updates over the configured host interface and are available only when the device is booted in DFU mode. DFU process:
Boot device to DFU mode with the Bootloader interface
Wait for sl_bt_evt_dfu_boot event
Send command sl_bt_dfu_flash_set_address command to start the firmware update
Upload the firmware with sl_bt_dfu_flash_upload commands until all data is uploaded
Send sl_bt_dfu_flash_upload_finish command when all data is uploaded
Finalize DFU firmware update with sl_bt_system_reboot command
DFU mode is using the UART baudrate set in bootloader.
Modules#
Functions#
Macros#
Function Documentation#
sl_bt_dfu_flash_set_address#
sl_status_t sl_bt_dfu_flash_set_address (uint32_t address)
[in] | address | The offset in the flash where the new firmware is uploaded to. Always use the value 0x00000000. |
After re-booting the local device in DFU mode, this command defines the starting address on the flash where the new firmware will be written.
Returns
SL_STATUS_OK if successful. Error code otherwise.
215
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_dfu_flash_upload#
sl_status_t sl_bt_dfu_flash_upload (size_t data_len, const uint8_t * data)
[in] | data_len | Length of data in |
[in] | data | An array of data which will be written onto the flash. |
Upload the whole firmware image file into the Bluetooth device. The passed data length must be a multiple of 4 bytes. Because the BGAPI command payload size is limited, multiple commands need to be issued one after the other until the whole firmware image file is uploaded to the device. After each command, the next address of the flash sector in memory to write to is automatically updated by the bootloader.
Returns
SL_STATUS_OK if successful. Error code otherwise.
232
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_dfu_flash_upload_finish#
sl_status_t sl_bt_dfu_flash_upload_finish ()
Inform the device that the DFU file is fully uploaded. To return the device back to user application mode, issue command sl_bt_system_reboot.
Returns
SL_STATUS_OK if successful. Error code otherwise.
243
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
Macro Definition Documentation#
sl_bt_cmd_dfu_flash_set_address_id#
#define sl_bt_cmd_dfu_flash_set_address_idValue:
0x01000020
153
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_cmd_dfu_flash_upload_id#
#define sl_bt_cmd_dfu_flash_upload_idValue:
0x02000020
154
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_cmd_dfu_flash_upload_finish_id#
#define sl_bt_cmd_dfu_flash_upload_finish_idValue:
0x03000020
155
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_rsp_dfu_flash_set_address_id#
#define sl_bt_rsp_dfu_flash_set_address_idValue:
0x01000020
156
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_rsp_dfu_flash_upload_id#
#define sl_bt_rsp_dfu_flash_upload_idValue:
0x02000020
157
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h
sl_bt_rsp_dfu_flash_upload_finish_id#
#define sl_bt_rsp_dfu_flash_upload_finish_idValue:
0x03000020
158
of file /mnt/raid/workspaces/ws.cynwT2I6w/overlay/gsdk/protocol/bluetooth/build/native/ble_host/ble_bgapi/inc/sl_bt_api.h