User Config Macros

group group_dfu_macro_config

Defines

CY_DFU_SIZEOF_CMD_BUFFER

The size of a buffer to hold DFU commands.

CY_DFU_SIZEOF_DATA_BUFFER

The size of a buffer to hold an NVM row of data to write or verify.

CY_DFU_OPT_GOLDEN_IMAGE

Set to non-zero for the DFU SDK Program Data command to check if the Golden image is going to be overwritten while updating.

CY_DFU_GOLDEN_IMAGE_IDS()

List of Golden Image Application IDs.

Here “Golden Image Application” means an application that cannot be changed with CommandProgramData()

Usage. Define the list of Golden Image Application IDs without enclosing parenthesis, e.g.

#define CY_DFU_GOLDEN_IMAGE_IDS()     0U, 1U, 3U 
later it is used in cy_dfu.c file:
uint8_t goldenImages[] = { CY_DFU_GOLDEN_IMAGE_IDS() }; 

CY_DFU_MAX_APPS

The number of applications in the metadata, for 512 bytes in a flash row - 63 is the maximum possible value, because 4 bytes are reserved for the entire metadata CRC.

The smallest metadata size if CY_DFU_MAX_APPS * 8 (bytes per one app) + 4 (bytes for CRC-32C)

CY_DFU_OPT_VERIFY_DATA

A non-zero value enables the Verify Data DFU command.

CY_DFU_OPT_ERASE_DATA

A non-zero value enables the Erase Data DFU command.

CY_DFU_OPT_VERIFY_APP

A non-zero value enables the Verify App DFU command.

CY_DFU_OPT_SEND_DATA

A non-zero value enables the Send Data DFU command.

If the “Send Data” DFU command is enabled, packetBuffer and dataBuffer must be non-overlapping.

Else, dataBuffer must be inside packetBuffer with an offset of CY_DFU_PACKET_DATA_IDX, typically 4 bytes.

params->dataBuffer = &packetBuffer[4];

note

that packetBuffer in this case must be 4 bytes aligned, as dataBuffer is required to be 4 bytes aligned.

CY_DFU_OPT_GET_METADATA

A non-zero value enables the Get Metadata DFU command.

CY_DFU_OPT_SET_EIVECTOR

A non-zero value enables the Set EI Vector DFU command.

CY_DFU_METADATA_WRITABLE

A non-zero value allows writing metadata with the Set App Metadata DFU command.

CY_DFU_OPT_CRYPTO_HW

Non-zero value enables the usage of hardware Crypto API.

CY_DFU_OPT_PACKET_CRC

A non-zero value enables the usage of CRC-16 for DFU packet verification.