DFU types

nRF5 SDK v15.3.0

Data Structures

struct nrf_dfu_bank_t
Description of a single bank. More...
struct dfu_progress_t
struct nrf_dfu_peer_data_t
struct nrf_dfu_adv_name_t
struct boot_validation_t
struct nrf_dfu_settings_t
DFU settings for application and bank data. More...

Macros

#define INIT_COMMAND_MAX_SIZE 512
#define INIT_COMMAND_MAX_SIZE_v1 256
#define DATA_OBJECT_MAX_SIZE (CODE_PAGE_SIZE)
Size of a flash page. This value is used for calculating the size of the reserved flash space in the bootloader region. More...
#define BOOTLOADER_SETTINGS_PAGE_SIZE (CODE_PAGE_SIZE)
Page location of the bootloader settings address.
#define NRF_UICR_MBR_PARAMS_PAGE_ADDRESS ( MBR_PARAM_PAGE_ADDR )
Location of the pointer to MBR params page. More...
#define NRF_MBR_PARAMS_PAGE_SIZE (CODE_PAGE_SIZE)
#define BOOTLOADER_SETTINGS_BACKUP_ADDRESS NRF_MBR_PARAMS_PAGE_ADDRESS
Page location of the MBR parameters page address.
#define NRF_DFU_APP_DATA_AREA_SIZE (CODE_PAGE_SIZE * 3)
#define DFU_APP_DATA_RESERVED NRF_DFU_APP_DATA_AREA_SIZE
#define DFU_REGION_END (bootloader_start_addr)   ((bootloader_start_addr) - ( NRF_DFU_APP_DATA_AREA_SIZE ))
Total size of the region between the SoftDevice and the bootloader.
#define DFU_REGION_START ( nrf_dfu_bank0_start_addr ())
#define DFU_REGION_TOTAL_SIZE (( DFU_REGION_END ) - (DFU_REGION_START))
#define NRF_DFU_CURRENT_BANK_0 0x00
#define NRF_DFU_CURRENT_BANK_1 0x01
#define NRF_DFU_BANK_LAYOUT_DUAL 0x00
#define NRF_DFU_BANK_LAYOUT_SINGLE 0x01
#define NRF_DFU_BANK_INVALID 0x00
DFU bank state codes. More...
#define NRF_DFU_BANK_VALID_APP 0x01
#define NRF_DFU_BANK_VALID_SD 0xA5
#define NRF_DFU_BANK_VALID_BL 0xAA
#define NRF_DFU_BANK_VALID_SD_BL 0xAC
#define NRF_DFU_BANK_VALID_EXT_APP 0xB1
#define NRF_DFU_PEER_DATA_LEN 64
#define NRF_DFU_ADV_NAME_LEN 28
#define SETTINGS_RESERVED_AREA_SIZE 16
#define SETTINGS_BOOT_VALIDATION_SIZE 64

Typedefs

typedef void(* nrf_dfu_observer_t )( nrf_dfu_evt_type_t notification)
Function for notifying DFU state.

Enumerations

enum nrf_dfu_evt_type_t {
NRF_DFU_EVT_DFU_INITIALIZED ,
NRF_DFU_EVT_TRANSPORT_ACTIVATED ,
NRF_DFU_EVT_TRANSPORT_DEACTIVATED ,
NRF_DFU_EVT_DFU_STARTED ,
NRF_DFU_EVT_OBJECT_RECEIVED ,
NRF_DFU_EVT_DFU_FAILED ,
NRF_DFU_EVT_DFU_COMPLETED ,
NRF_DFU_EVT_DFU_ABORTED
}
Event types in the bootloader and DFU process. More...
enum boot_validation_type_t {
NO_VALIDATION ,
VALIDATE_CRC ,
VALIDATE_SHA256 ,
VALIDATE_ECDSA_P256_SHA256
}

Functions

STATIC_ASSERT (((CODE_PAGE_SIZE *3)%CODE_PAGE_SIZE)==0,"NRF_DFU_APP_DATA_AREA_SIZE must be a multiple of the flash page size.")
STATIC_ASSERT (sizeof( nrf_dfu_peer_data_t )==64,"nrf_dfu_peer_data_t has unexpected length. This can cause incompatibility with tools.")
STATIC_ASSERT (sizeof( nrf_dfu_adv_name_t )==28,"nrf_dfu_adv_name_t has unexpected length. This can cause incompatibility with tools.")

Variables

ANON_UNIONS_ENABLE
DFU progress. More...
ANON_UNIONS_DISABLE

Detailed Description

Macro Definition Documentation

#define DATA_OBJECT_MAX_SIZE   (CODE_PAGE_SIZE)

Size of a flash page. This value is used for calculating the size of the reserved flash space in the bootloader region.

Maximum size of a data object.

#define INIT_COMMAND_MAX_SIZE   512

Maximum size of the init command stored in dfu_settings.

#define INIT_COMMAND_MAX_SIZE_v1   256

Maximum size of the init command in settings version 1.

#define NRF_DFU_ADV_NAME_LEN   28

The length in bytes of nrf_dfu_adv_name_t expected by tools manipulating the settings page. Do not change without changing the settings page version.

#define NRF_DFU_BANK_INVALID   0x00

DFU bank state codes.

The DFU bank state indicates the content of a bank: A valid image of a certain type or an invalid image.Invalid image.

#define NRF_DFU_BANK_VALID_APP   0x01

Valid application.

#define NRF_DFU_BANK_VALID_BL   0xAA

Valid bootloader.

#define NRF_DFU_BANK_VALID_EXT_APP   0xB1

Valid application designated for a remote node.

#define NRF_DFU_BANK_VALID_SD   0xA5

Valid SoftDevice.

#define NRF_DFU_BANK_VALID_SD_BL   0xAC

Valid SoftDevice and bootloader.

#define NRF_DFU_PEER_DATA_LEN   64

The length in bytes of nrf_dfu_peer_data_t expected by tools manipulating the settings page. Do not change without changing the settings page version.

#define NRF_UICR_MBR_PARAMS_PAGE_ADDRESS   ( MBR_PARAM_PAGE_ADDR )

Location of the pointer to MBR params page.

See also MBR_PARAMS_PAGE_ADDRESS in app_util.h .

#define SETTINGS_BOOT_VALIDATION_SIZE   64

The number of bytes reserved for boot_validation value.

#define SETTINGS_RESERVED_AREA_SIZE   16

The number of words in the reserved area of the DFU settings.

Enumeration Type Documentation

Event types in the bootloader and DFU process.

Enumerator
NRF_DFU_EVT_DFU_INITIALIZED

Starting DFU.

NRF_DFU_EVT_TRANSPORT_ACTIVATED

Transport activated (e.g. BLE connected, USB plugged in).

NRF_DFU_EVT_TRANSPORT_DEACTIVATED

Transport deactivated (e.g. BLE disconnected, USB plugged out).

NRF_DFU_EVT_DFU_STARTED

DFU process started.

NRF_DFU_EVT_OBJECT_RECEIVED

A DFU data object has been received.

NRF_DFU_EVT_DFU_FAILED

DFU process has failed, been interrupted, or hung.

NRF_DFU_EVT_DFU_COMPLETED

DFU process completed.

NRF_DFU_EVT_DFU_ABORTED

DFU process aborted.

Variable Documentation

ANON_UNIONS_ENABLE

DFU progress.

Be aware of the difference between objects and firmware images. A firmware image consists of multiple objects, each of a maximum size DATA_OBJECT_MAX_SIZE .

Note
The union inside this struct is cleared when CREATE_OBJECT of command type is executed, and when there is a valid post-validation. In DFU activation (after reset) the dfu_progress_t::update_start_address will be used in case of a SD/SD+BL update.