Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB EZ-PD™ Type-C Forum Discussions

Ivan_Lee
Level 5
Level 5
5 likes given 100 sign-ins First like received

CCG5 workspace incudes two projects:

1). backup_fw ( image-0)

2). CYPD5225 notebook ( image-1 )

How to change image-1 start address and meta data address ?

0 Likes
1 Solution
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi Ivan,

Before tell the parameters, I could like to introduce the latest CCG5 firmware structure at first, so that you can change the concerned parameters/define as per your requirements.

pastedImage_0.png

So that the bootloader last row defined in the flash_config.h and com0gcc.ld is below for CCG5 project:

1. In firmware project: (@file flash_config.h)

/* Last Boot loader row. This field should be changed only when there is a

* project level change. A change to this field should be synchronous with

* the following fields:

*   -> boot-loader cm0gcc.ld file configSection location:

*      = ((CY_PD_BOOT_LOADER_LAST_ROW + 1) << CY_PD_FLASH_ROW_SHIFT_NUM)

*   -> firmware boot-loadable component firmware start location:

*      = (CY_PD_CONFIG_TABLE_ADDRESS + CY_PD_CONFIG_TABLE_SIZE) */

#define CCG_BOOT_LOADER_LAST_ROW                (0x13)

/* This MACRO defines the last row occupied by FW Image 1. FW Image 1 uses

* this information to determine the section of flash assigned for FW Image 2. */

#define CCG_IMG1_LAST_FLASH_ROW_NUM             (0x9F)

/* This MACRO defines the last row occupied by FW Image 2. */

#define CCG_IMG2_LAST_FLASH_ROW_NUM             (CCG_IMG2_METADATA_ROW_NUM - 1)

/* Configuration table is located at a fixed offset of 0x100 from start of firmware location. */

#define CCG_FW_CONFTABLE_OFFSET                 (0x100)

/* Config table address boundary used to distinguish between FW1 and FW2. */

#define CCG_FW1_CONFTABLE_MAX_ADDR              (0x8000)

You shall update those defines of your project to match your design.

2. cm0gcc.ld

/*

* Place the image at an offset of 0xC000. The space before is reserved for the

* bootloader and back-up image.

*/

CY_APPL_ORIGIN                  = 0xC000;

CY_FLASH_ROW_SIZE               = 256;

CY_APPL_NUM                     = 1;

CY_APPL_MAX                     = 2;

CY_METADATA_SIZE                = 64;

CY_APPL_LOADABLE                = 1;

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(0, CY_FLASH_ROW_SIZE);

CY_APP_FOR_STACK_AND_COPIER     = 0;

Best Regards,

Lisa

View solution in original post

0 Likes
2 Replies
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi Ivan,

Before tell the parameters, I could like to introduce the latest CCG5 firmware structure at first, so that you can change the concerned parameters/define as per your requirements.

pastedImage_0.png

So that the bootloader last row defined in the flash_config.h and com0gcc.ld is below for CCG5 project:

1. In firmware project: (@file flash_config.h)

/* Last Boot loader row. This field should be changed only when there is a

* project level change. A change to this field should be synchronous with

* the following fields:

*   -> boot-loader cm0gcc.ld file configSection location:

*      = ((CY_PD_BOOT_LOADER_LAST_ROW + 1) << CY_PD_FLASH_ROW_SHIFT_NUM)

*   -> firmware boot-loadable component firmware start location:

*      = (CY_PD_CONFIG_TABLE_ADDRESS + CY_PD_CONFIG_TABLE_SIZE) */

#define CCG_BOOT_LOADER_LAST_ROW                (0x13)

/* This MACRO defines the last row occupied by FW Image 1. FW Image 1 uses

* this information to determine the section of flash assigned for FW Image 2. */

#define CCG_IMG1_LAST_FLASH_ROW_NUM             (0x9F)

/* This MACRO defines the last row occupied by FW Image 2. */

#define CCG_IMG2_LAST_FLASH_ROW_NUM             (CCG_IMG2_METADATA_ROW_NUM - 1)

/* Configuration table is located at a fixed offset of 0x100 from start of firmware location. */

#define CCG_FW_CONFTABLE_OFFSET                 (0x100)

/* Config table address boundary used to distinguish between FW1 and FW2. */

#define CCG_FW1_CONFTABLE_MAX_ADDR              (0x8000)

You shall update those defines of your project to match your design.

2. cm0gcc.ld

/*

* Place the image at an offset of 0xC000. The space before is reserved for the

* bootloader and back-up image.

*/

CY_APPL_ORIGIN                  = 0xC000;

CY_FLASH_ROW_SIZE               = 256;

CY_APPL_NUM                     = 1;

CY_APPL_MAX                     = 2;

CY_METADATA_SIZE                = 64;

CY_APPL_LOADABLE                = 1;

CY_CHECKSUM_EXCLUDE_SIZE        = ALIGN(0, CY_FLASH_ROW_SIZE);

CY_APP_FOR_STACK_AND_COPIER     = 0;

Best Regards,

Lisa

0 Likes
Ivan_Lee
Level 5
Level 5
5 likes given 100 sign-ins First like received

for example , i want change image1's start address to "row number 0xA5"

I only need to modify below defines, correct??

1. modify flash_config.h file, change  CCG_IMG1_LAST_FLASH_ROW_NUM   to 0xA5

/* This MACRO defines the last row occupied by FW Image 1. FW Image 1 uses

* this information to determine the section of flash assigned for FW Image 2. */

#define CCG_IMG1_LAST_FLASH_ROW_NUM             (0xA5)      // (0xA2)

2. modify cm0mdk.scat file, chagne CY_APP_ORIGIN to 0xA500

#define CY_APPL_ORIGIN                  0xA500

0 Likes