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

USB EZ-PD™ Type-C

NaMe_2085021
Level 4
25 replies posted 10 replies posted 10 questions asked
Level 4

Hi guys,

I use CYPD3120 USB Type C controller with SDK. 

Can you explain what these lines mean?

Please see an example piece of code from the main.c file:

.......................................................................................................................

__attribute__ ((section(".customer_region"), used))
const uint32_t customer_info[8] = {0x00};

/* Place the bootloader version at a fixed location, so that firmware can retrieve this as well. */
__attribute__ ((section(".base_version"), used))
const uint32_t base_version = FW_BASE_VERSION;
__attribute__ ((section(".app_version"), used))
const uint32_t app_version = APP_VERSION;
__attribute__ ((section(".dev_siliconid"), used))
const uint32_t ccg_silicon_id = MAKE_DWORD_FROM_WORD (CCG_DEV_SILICON_ID, CCG_DEV_FAMILY_ID);
__attribute__ ((section(".fw_reserved"), used))
const uint32_t reserved_buf[5] = {0};

.......................................................................................................................

Best regards,

Nazar Melnichek

0 Likes
1 Solution
Sananya_14
Moderator
Moderator 750 replies posted 500 replies posted 250 solutions authored
Moderator

Hi Nazar,

These lines are used to place certain parts of the code at fixed locations as per the firmware architecture. For e.g. __attribute__ ((section(".customer_region"), used)) will place the customer information which can be modified in the configuration as user parameters at an offset of 0xC0 from the firmware image start. This can be further checked in the linker script of the project.

Best Regards,
Sananya

View solution in original post

0 Likes
1 Reply
Sananya_14
Moderator
Moderator 750 replies posted 500 replies posted 250 solutions authored
Moderator

Hi Nazar,

These lines are used to place certain parts of the code at fixed locations as per the firmware architecture. For e.g. __attribute__ ((section(".customer_region"), used)) will place the customer information which can be modified in the configuration as user parameters at an offset of 0xC0 from the firmware image start. This can be further checked in the linker script of the project.

Best Regards,
Sananya

0 Likes