Allows for some basic control of the application-side DFU module.
More...
Allows for some basic control of the application-side DFU module.
All DFU related events are defined in the main API-header.
◆ nrf_mesh_dfu_init()
uint32_t nrf_mesh_dfu_init |
( |
void |
| ) |
|
Initialize the DFU module.
- Return values
-
NRF_SUCCESS | The dfu-module was successfully initialized. |
NRF_ERROR_NOT_FOUND | The dfu-module was unable to find the bootloader or the bootloader device page. |
◆ nrf_mesh_dfu_jump_to_bootloader()
uint32_t nrf_mesh_dfu_jump_to_bootloader |
( |
void |
| ) |
|
Manually trigger the bootloader.
The device will be reset immediately, and may not be available for regular operation for several minutes. If successful, this function does not return.
- Return values
-
NRF_ERROR_FORBIDDEN | The NRF_UICR->BOOTLOADERADDR persistent register has not been set, and the bootloader could not start. |
◆ nrf_mesh_dfu_rx()
uint32_t nrf_mesh_dfu_rx |
( |
const uint8_t * |
p_packet, |
|
|
uint32_t |
length, |
|
|
const nrf_mesh_rx_metadata_t * |
p_metadata |
|
) |
| |
Pass a dfu packet to the dfu module.
- Parameters
-
[in] | p_packet | A pointer to a DFU packet. |
[in] | length | The length of the DFU packet. |
[in] | p_metadata | Metadata attached to the packet that came in. |
- Return values
-
NRF_SUCCESS | The packet was successfully handled by the DFU module. |
NRF_ERROR_BUSY | The dfu module can't accept the request at the moment. |
NRF_ERROR_INVALID_ADDR | The packet isn't a known DFU packet. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
◆ nrf_mesh_dfu_request()
Request a DFU transfer.
The DFU transfer will run alongside the application, and store the firmware in the given bank.
Generates events:
- Parameters
-
[in] | type | DFU type to request. |
[in] | p_fwid | Firmware ID to request. |
[in,out] | p_bank_addr | Address in which to store the banked data. Any existing data in this location will be erased. |
- Return values
-
NRF_SUCCESS | The dfu module has started requesting the given transfer. |
NRF_ERROR_NULL | One of the parameters provided was null. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_INVALID_PARAM | The given dfu type is not available. |
NRF_ERROR_INVALID_STATE | The DFU module is not in an idle state, and the operation can't be started. This can either be because the application failed to initialize the module, or because a DFU operation is currently in progress. In the last case, stop the current operation with nrf_mesh_dfu_abort() or wait for an end-event before requesting a new transfer. |
◆ nrf_mesh_dfu_relay()
Relay an ongoing transfer.
Should only be used as a response to an NRF_MESH_EVT_DFU_REQ_RELAY.
Generates events:
- Parameters
-
[in] | type | DFU type to request. |
[in] | p_fwid | Firmware ID to request. |
- Return values
-
NRF_SUCCESS | The dfu module has started advertising its intention to relay the given transfer. |
NRF_ERROR_NULL | The FWID pointer provided was NULL. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_INVALID_PARAM | The given dfu type is not available. |
NRF_ERROR_INVALID_STATE | The DFU module is not in an idle state, and the operation can't be started. This can either be because the application failed to initialize the module, or because a DFU operation is currently in progress. In the last case, stop the current operation with nrf_mesh_dfu_abort() or wait for an end-event before requesting a new transfer. |
◆ nrf_mesh_dfu_abort()
uint32_t nrf_mesh_dfu_abort |
( |
void |
| ) |
|
Abort the ongoing dfu operation.
- Return values
-
NRF_SUCCES | The ongoing dfu operation was successfully stopped, and the DFU module went back to the idle state. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_INVALID_STATE | The dfu module was not doing any dfu operations. |
◆ nrf_mesh_dfu_bank_info_get()
Get info on the bank of the given type.
- Parameters
-
[in] | type | Type of the bank to get info on. |
[out] | p_bank_info | Pointer to a structure which the function will put information on the bank in. |
- Return values
-
NRF_SUCCESS | The bank was found, and the p_bank_info parameter was filled with the correct paramters. |
NRF_ERROR_NULL | The bank info pointer provided was NULL. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_NOT_FOUND | No bank of the given type was found. |
NRF_ERROR_INVALID_STATE | The DFU module has not been initialized. |
◆ nrf_mesh_dfu_bank_flash()
Flash the bank of the given type.
- Warning
- This will trigger a restart of the chip. All non-volatile memory will be lost during this call. If successful, this never returns.
- Parameters
-
[in] | bank_type | The dfu type of the bank to be flashed. There can only be one bank of each dfu type. |
- Return values
-
NRF_ERROR_NOT_FOUND | No bank of the given type is available. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_INVALID_STATE | The DFU module has not been initialized. |
◆ nrf_mesh_dfu_state_get()
Get the current state of the DFU module.
- Parameters
-
[out] | p_dfu_transfer_state | A pointer to a dfu transfer state variable, which the framework will fill with the current state/progress of an ongoing transfer, if any. |
- Return values
-
NRF_SUCCESS | The dfu state was successfully retrieved. |
NRF_ERROR_NULL | The transfer state pointer provided was NULL. |
NRF_ERROR_NOT_SUPPORTED | The dfu functionality is not available. |
NRF_ERROR_INVALID_STATE | The DFU module has not been initialized. |