Device Firmware Update (DFU) Middleware Library 5.1
User Config Macros

General Description

Macros

#define CY_DFU_LOG_LEVEL   CY_DFU_LOG_LEVEL_OFF
 Defines log level.
 
#define CY_DFU_BASIC_FLOW   (0U)
 Basic Bootloader flow includes application transfer and bootload. More...
 
#define CY_DFU_MCUBOOT_FLOW   (1U)
 MCUBoot compatibility flow includes only application transport. More...
 
#define CY_DFU_FLOW   (CY_DFU_MCUBOOT_FLOW)
 Configuration option to select DFU flow. More...
 
#define CY_NVM_SIZEOF_ROW   (512)
 Define program row size of the Non-Volatile memory.
 
#define CY_DFU_SIZEOF_CMD_BUFFER   (CY_NVM_SIZEOF_ROW + 16U)
 The size of a buffer to hold DFU commands.
 
#define CY_DFU_SIZEOF_DATA_BUFFER   (CY_NVM_SIZEOF_ROW + 16U)
 The size of a buffer to hold an NVM row of data to write or verify.
 
#define CY_DFU_OPT_VERIFY_DATA   (1)
 A non-zero value enables the Verify Data DFU command.
 
#define CY_DFU_OPT_ERASE_DATA   (1)
 A non-zero value enables the Erase Data DFU command.
 
#define CY_DFU_OPT_VERIFY_APP   (1)
 A non-zero value enables the Verify App DFU command.
 
#define CY_DFU_OPT_SEND_DATA   (1)
 A non-zero value enables the Send Data DFU command. More...
 
#define CY_DFU_OPT_PACKET_CRC   (0)
 A non-zero value enables the usage of CRC-16 for DFU packet verification.
 
#define CY_DFU_OPT_CUSTOM_CMD   (0)
 A non-zero value enables the user custom command support.
 
#define CY_DFU_MAX_APPS   (2U)
 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. More...
 
#define CY_DFU_OPT_GOLDEN_IMAGE   (0)
 Set to non-zero for the DFU SDK Program Data command to check if the Golden image is going to be overwritten while updating.
 
#define CY_DFU_GOLDEN_IMAGE_IDS()   0U
 List of Golden Image Application IDs. More...
 
#define CY_DFU_OPT_GET_METADATA   (1)
 A non-zero value enables the Get Metadata DFU command.
 
#define CY_DFU_OPT_SET_EIVECTOR   (0)
 A non-zero value enables the Set EI Vector DFU command.
 
#define CY_DFU_METADATA_WRITABLE   (1)
 A non-zero value allows writing metadata with the Set App Metadata DFU command. More...
 
#define CY_DFU_OPT_CRYPTO_HW   (0)
 Non-zero value enables the usage of hardware Crypto API.
 

Macro Definition Documentation

◆ CY_DFU_BASIC_FLOW

#define CY_DFU_BASIC_FLOW   (0U)

Basic Bootloader flow includes application transfer and bootload.

◆ CY_DFU_MCUBOOT_FLOW

#define CY_DFU_MCUBOOT_FLOW   (1U)

MCUBoot compatibility flow includes only application transport.

◆ CY_DFU_FLOW

#define CY_DFU_FLOW   (CY_DFU_MCUBOOT_FLOW)

Configuration option to select DFU flow.

Possible options are:

◆ CY_DFU_OPT_SEND_DATA

#define CY_DFU_OPT_SEND_DATA   (1)

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_MAX_APPS

#define CY_DFU_MAX_APPS   (2U)

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_GOLDEN_IMAGE_IDS

#define CY_DFU_GOLDEN_IMAGE_IDS ( )    0U

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_METADATA_WRITABLE

#define CY_DFU_METADATA_WRITABLE   (1)

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