DFU settings

nRF5 SDK v16.0.0

Functions

ret_code_t nrf_dfu_settings_write ( nrf_dfu_flash_callback_t callback)
Function for writing DFU settings to flash. More...
void nrf_dfu_settings_backup ( nrf_dfu_flash_callback_t callback)
Function for backing up the settings. More...
ret_code_t nrf_dfu_settings_write_and_backup ( nrf_dfu_flash_callback_t callback)
Function for writing DFU settings to flash and to backup. More...
void nrf_dfu_settings_reinit (void)
Function for initializing the DFU settings structure. More...
ret_code_t nrf_dfu_settings_init (bool sd_irq_initialized)
Function for initializing the DFU settings module. More...
ret_code_t nrf_dfu_settings_additional_erase (void)
Function for erasing additional data in DFU settings. More...

Detailed Description

Function Documentation

ret_code_t nrf_dfu_settings_additional_erase ( void )

Function for erasing additional data in DFU settings.

Note
Erasing additional data in DFU settings is only possible if nrf_dfu_flash is initialized to not use SoftDevice calls.
Return values
NRF_SUCCESS Additional data was successfully erased.
Any other error code reported by nrf_dfu_flash
void nrf_dfu_settings_backup ( nrf_dfu_flash_callback_t callback )

Function for backing up the settings.

This function copies the contents of the settings page (in flash) to a separate page (in flash). During nrf_dfu_settings_init , the backup is restored if the original is invalid.

Parameters
[in] callback Pointer to a function that is called after completing the write operation.
ret_code_t nrf_dfu_settings_init ( bool sd_irq_initialized )

Function for initializing the DFU settings module.

Return values
NRF_SUCCESS If the initialization was successful.
NRF_ERROR_INTERNAL If a flash error occurred.
void nrf_dfu_settings_reinit ( void )

Function for initializing the DFU settings structure.

Initializes the RAM structure from the flash contents. This function is called as part of nrf_dfu_settings_init .

Return values
NRF_SUCCESS If the initialization was successful.
NRF_ERROR_INTERNAL If a flash error occurred.
ret_code_t nrf_dfu_settings_write ( nrf_dfu_flash_callback_t callback )

Function for writing DFU settings to flash.

Parameters
[in] callback Pointer to a function that is called after completing the write operation.
Return values
NRF_SUCCESS If the write process was successfully initiated.
NRF_ERROR_INTERNAL If a flash error occurred.
ret_code_t nrf_dfu_settings_write_and_backup ( nrf_dfu_flash_callback_t callback )

Function for writing DFU settings to flash and to backup.

This function first calls nrf_dfu_settings_write and then nrf_dfu_settings_backup .

Parameters
[in] callback Pointer to a function that is called after completing the write and backup operation.
Return values
NRF_SUCCESS If the write process was successfully initiated.
NRF_ERROR_INTERNAL If a flash error occurred during the first write.

Variable Documentation

nrf_dfu_settings_t s_dfu_settings

Global settings.

Note
Using this variable is not thread-safe.