nRF5 SDK v13.0.0
Enumerations | Functions
DFU result codes

When the DFU controller sends requests to the DFU bootloader on the DFU target, the DFU bootloader answers with any of these result codes. More...

Enumerations

enum  nrf_dfu_res_code_t {
  NRF_DFU_RES_CODE_INVALID = 0x00,
  NRF_DFU_RES_CODE_SUCCESS = 0x01,
  NRF_DFU_RES_CODE_OP_CODE_NOT_SUPPORTED = 0x02,
  NRF_DFU_RES_CODE_INVALID_PARAMETER = 0x03,
  NRF_DFU_RES_CODE_INSUFFICIENT_RESOURCES = 0x04,
  NRF_DFU_RES_CODE_INVALID_OBJECT = 0x05,
  NRF_DFU_RES_CODE_UNSUPPORTED_TYPE = 0x07,
  NRF_DFU_RES_CODE_OPERATION_NOT_PERMITTED = 0x08,
  NRF_DFU_RES_CODE_OPERATION_FAILED = 0x0A,
  NRF_DFU_RES_CODE_EXT_ERROR = 0x0B
}
 DFU request result codes. More...
 
enum  nrf_dfu_ext_error_code_t {
  NRF_DFU_EXT_ERROR_NO_ERROR = 0x00,
  NRF_DFU_EXT_ERROR_INVALID_ERROR_CODE = 0x01,
  NRF_DFU_EXT_ERROR_WRONG_COMMAND_FORMAT = 0x02,
  NRF_DFU_EXT_ERROR_UNKNOWN_COMMAND = 0x03,
  NRF_DFU_EXT_ERROR_INIT_COMMAND_INVALID = 0x04,
  NRF_DFU_EXT_ERROR_FW_VERSION_FAILURE = 0x05,
  NRF_DFU_EXT_ERROR_HW_VERSION_FAILURE = 0x06,
  NRF_DFU_EXT_ERROR_SD_VERSION_FAILURE = 0x07,
  NRF_DFU_EXT_ERROR_SIGNATURE_MISSING = 0x08,
  NRF_DFU_EXT_ERROR_WRONG_HASH_TYPE = 0x09,
  NRF_DFU_EXT_ERROR_HASH_FAILED = 0x0A,
  NRF_DFU_EXT_ERROR_WRONG_SIGNATURE_TYPE = 0x0B,
  NRF_DFU_EXT_ERROR_VERIFICATION_FAILED = 0x0C,
  NRF_DFU_EXT_ERROR_INSUFFICIENT_SPACE = 0x0D
}
 DFU request extended result codes. More...
 

Functions

nrf_dfu_res_code_t ext_error_set (nrf_dfu_ext_error_code_t error_code)
 Function for setting an extended error code that can be retrieved later. More...
 
nrf_dfu_ext_error_code_t ext_error_get (void)
 Function for getting the most recent extended error code. More...
 

Detailed Description

When the DFU controller sends requests to the DFU bootloader on the DFU target, the DFU bootloader answers with any of these result codes.

Enumeration Type Documentation

DFU request extended result codes.

When an event returns NRF_DFU_RES_CODE_EXT_ERROR, it also stores an extended error code. The transport layer can then send the extended error code together with the error code to give the controller additional information about the cause of the error.

Enumerator
NRF_DFU_EXT_ERROR_NO_ERROR 

No extended error code has been set. This error indicates an implementation problem.

NRF_DFU_EXT_ERROR_INVALID_ERROR_CODE 

Invalid error code. This error code should never be used outside of development.

NRF_DFU_EXT_ERROR_WRONG_COMMAND_FORMAT 

The format of the command was incorrect. This error code is not used in the current implementation, because NRF_DFU_RES_CODE_OP_CODE_NOT_SUPPORTED and NRF_DFU_RES_CODE_INVALID_PARAMETER cover all possible format errors.

NRF_DFU_EXT_ERROR_UNKNOWN_COMMAND 

The command was successfully parsed, but it is not supported or unknown.

NRF_DFU_EXT_ERROR_INIT_COMMAND_INVALID 

The init command is invalid. The init packet either has an invalid update type or it is missing required fields for the update type (for example, the init packet for a SoftDevice update is missing the SoftDevice size field).

NRF_DFU_EXT_ERROR_FW_VERSION_FAILURE 

The firmware version is too low. For an application, the version must be greater than the current application. For a bootloader, it must be greater than or equal to the current version. This requirement prevents downgrade attacks.

NRF_DFU_EXT_ERROR_HW_VERSION_FAILURE 

The hardware version of the device does not match the required hardware version for the update.

NRF_DFU_EXT_ERROR_SD_VERSION_FAILURE 

The array of supported SoftDevices for the update does not contain the FWID of the current SoftDevice.

NRF_DFU_EXT_ERROR_SIGNATURE_MISSING 

The init packet does not contain a signature. This error code is not used in the current implementation, because init packets without a signature are regarded as invalid.

NRF_DFU_EXT_ERROR_WRONG_HASH_TYPE 

The hash type that is specified by the init packet is not supported by the DFU bootloader.

NRF_DFU_EXT_ERROR_HASH_FAILED 

The hash of the firmware image cannot be calculated.

NRF_DFU_EXT_ERROR_WRONG_SIGNATURE_TYPE 

The type of the signature is unknown or not supported by the DFU bootloader.

NRF_DFU_EXT_ERROR_VERIFICATION_FAILED 

The hash of the received firmware image does not match the hash in the init packet.

NRF_DFU_EXT_ERROR_INSUFFICIENT_SPACE 

The available space on the device is insufficient to hold the firmware.

DFU request result codes.

The DFU transport layer creates request events of type nrf_dfu_req_op_t. Such events return one of these result codes.

Enumerator
NRF_DFU_RES_CODE_INVALID 

Invalid opcode.

NRF_DFU_RES_CODE_SUCCESS 

Operation successful.

NRF_DFU_RES_CODE_OP_CODE_NOT_SUPPORTED 

Opcode not supported.

NRF_DFU_RES_CODE_INVALID_PARAMETER 

Missing or invalid parameter value.

NRF_DFU_RES_CODE_INSUFFICIENT_RESOURCES 

Not enough memory for the data object.

NRF_DFU_RES_CODE_INVALID_OBJECT 

Data object does not match the firmware and hardware requirements, the signature is wrong, or parsing the command failed.

NRF_DFU_RES_CODE_UNSUPPORTED_TYPE 

Not a valid object type for a Create request.

NRF_DFU_RES_CODE_OPERATION_NOT_PERMITTED 

The state of the DFU process does not allow this operation.

NRF_DFU_RES_CODE_OPERATION_FAILED 

Operation failed.

NRF_DFU_RES_CODE_EXT_ERROR 

Extended error. The next byte of the response contains the error code of the extended error (see nrf_dfu_ext_error_code_t).

Function Documentation

nrf_dfu_ext_error_code_t ext_error_get ( void  )

Function for getting the most recent extended error code.

This function is used by the transport layer to fetch the most recent extended error code.

Returns
The most recent error code. If the function is called again before a new error occurs, NRF_DFU_EXT_ERROR_NO_ERROR is returned.
nrf_dfu_res_code_t ext_error_set ( nrf_dfu_ext_error_code_t  error_code)

Function for setting an extended error code that can be retrieved later.

When an extended error occurs in the DFU process, this function can be used to store the error.

Parameters
error_codeThe error code to store.
Return values
NRF_DFU_RES_CODE_EXT_ERROR

Documentation feedback | Developer Zone | Subscribe | Updated