Modules | |
DFU validation configuration | |
Functions | |
void | nrf_dfu_validation_init (void) |
Function for module initialization. More... | |
nrf_dfu_result_t | nrf_dfu_validation_init_cmd_create (uint32_t size) |
Function called on reception of init command creation request. More... | |
nrf_dfu_result_t | nrf_dfu_validation_init_cmd_append (uint8_t const *p_data, uint32_t length) |
Function called on reception of fragment of init command. More... | |
void | nrf_dfu_validation_init_cmd_status_get (uint32_t *p_offset, uint32_t *p_crc, uint32_t *p_max_size) |
Function for getting init command status. More... | |
bool | nrf_dfu_validation_init_cmd_present (void) |
Function for inquiring whether a valid init command has been received. More... | |
nrf_dfu_result_t | nrf_dfu_validation_init_cmd_execute (uint32_t *p_dst_data_addr, uint32_t *p_data_len) |
Function for validating init command and retrieving the address and length of the firmware. More... | |
nrf_dfu_result_t | nrf_dfu_validation_prevalidate (void) |
Function for validating the init command. More... | |
bool | nrf_dfu_validation_boot_validate (boot_validation_t const *p_validation, uint32_t data_addr, uint32_t data_len) |
Function for validating the firmware for booting. More... | |
nrf_dfu_result_t | nrf_dfu_validation_post_data_execute (uint32_t data_addr, uint32_t data_len) |
Function for postvalidating the update after all data is received. More... | |
nrf_dfu_result_t | nrf_dfu_validation_activation_prepare (uint32_t data_addr, uint32_t data_len) |
Function for preparing the update for activation. More... | |
nrf_dfu_result_t | nrf_dfu_validation_post_external_app_execute (dfu_init_command_t const *p_init, bool is_trusted) |
Function to execute on a validated external app. More... | |
bool | nrf_dfu_validation_valid_external_app (void) |
Function to check if there is a valid external app in Bank 1. More... | |
nrf_dfu_result_t nrf_dfu_validation_activation_prepare | ( | uint32_t | data_addr, |
uint32_t | data_len | ||
) |
Function for preparing the update for activation.
This function is called after a reset, after all data is received. This function also runs nrf_dfu_validation_post_data_execute internally. If this succeeds, the update is activated by the activation machinery in the bootloader the next time it runs.
[in] | data_addr | Start address of the received data. |
[in] | data_len | Length of the received data. |
bool nrf_dfu_validation_boot_validate | ( | boot_validation_t const * | p_validation, |
uint32_t | data_addr, | ||
uint32_t | data_len | ||
) |
Function for validating the firmware for booting.
[in] | p_validation | Validation parameters. |
[in] | data_addr | Start address of the firmware. |
[in] | data_len | Length of the firmware. |
void nrf_dfu_validation_init | ( | void | ) |
Function for module initialization.
Function checks if there is a valid init packet in DFU settings written in flash.
nrf_dfu_result_t nrf_dfu_validation_init_cmd_append | ( | uint8_t const * | p_data, |
uint32_t | length | ||
) |
Function called on reception of fragment of init command.
[in] | p_data | Init command fragment. |
[in] | length | Init command fragment size. |
nrf_dfu_result_t nrf_dfu_validation_init_cmd_create | ( | uint32_t | size | ) |
Function called on reception of init command creation request.
[in] | size | Size of incoming init packet. |
nrf_dfu_result_t nrf_dfu_validation_init_cmd_execute | ( | uint32_t * | p_dst_data_addr, |
uint32_t * | p_data_len | ||
) |
Function for validating init command and retrieving the address and length of the firmware.
If init command is successfully validated Bank 1 details are written to out parameters.
Until nrf_dfu_validation_init_cmd_create is called, this function can be called again after the first time without side effects to retrieve address and length.
[out] | p_dst_data_addr | Start address of received data, if validation is successful. |
[out] | p_data_len | Expected length of received data, if validation is successful. |
bool nrf_dfu_validation_init_cmd_present | ( | void | ) |
Function for inquiring whether a valid init command has been received.
void nrf_dfu_validation_init_cmd_status_get | ( | uint32_t * | p_offset, |
uint32_t * | p_crc, | ||
uint32_t * | p_max_size | ||
) |
Function for getting init command status.
[out] | p_offset | Current offset. |
[out] | p_crc | Current CRC. |
[out] | p_max_size | Maximum size of init command. |
nrf_dfu_result_t nrf_dfu_validation_post_data_execute | ( | uint32_t | data_addr, |
uint32_t | data_len | ||
) |
Function for postvalidating the update after all data is received.
[in] | data_addr | Start address of the received data. |
[in] | data_len | Length of the received data. |
nrf_dfu_result_t nrf_dfu_validation_post_external_app_execute | ( | dfu_init_command_t const * | p_init, |
bool | is_trusted | ||
) |
Function to execute on a validated external app.
This function is called once all data is received with the parameter is_boot
set to false. The function is called during bootup with the parameter set to true.
is_trusted
must be used to ensure that no loss of security of process can happen. This parameter should only be set if the function is called after a root-of-trust reset on the device.Parameter is_trusted
can be used for the following:
[in] | p_init | Init command for the firmware upgrade. |
[in] | is_trusted | Must be set to true if this is called after root-of-trust boot. Must be set to false if this is called from DFU mode or background DFU operation. |
nrf_dfu_result_t nrf_dfu_validation_prevalidate | ( | void | ) |
Function for validating the init command.
bool nrf_dfu_validation_valid_external_app | ( | void | ) |
Function to check if there is a valid external app in Bank 1.