Code size optimization for a PD/BC SNK only functionality

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
PrRe_3492461
Level 4
Level 4
First like received 50 sign-ins 50 replies posted

Hi cypress,

I'm using ccg3pa for my custom product.

CCG3PA will only be used as a PD, BC1.2 SNK device.

I'm facing problems if my code size crosses above 98.6% of FLASH.

Are there any ENUMS that i can disable for reducing the code size, As I already told, My product is used as PD,BC1.2 SNK only.

So I believe Source related Enums can be disabled to reduce code size.

Please suggest if any settings or Enums that i can disable to reduce my code size.

Regards,

Pranay.

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Pranay,

In order to free up some space you can disable cable compensation by setting following macro,

#define CCG_CABLE_COMP_ENABLE           (0u)

You can also define QC_AFC_CHARGING_DISABLED (1) macro in battery_charging.h file to reduce flash utilization since these protocols are not being used.

Regards,

Pranava

Best regards,
Pranava

View solution in original post

3 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi Pranay,

In order to free up some space you can disable cable compensation by setting following macro,

#define CCG_CABLE_COMP_ENABLE           (0u)

You can also define QC_AFC_CHARGING_DISABLED (1) macro in battery_charging.h file to reduce flash utilization since these protocols are not being used.

Regards,

Pranava

Best regards,
Pranava

Hi pranava,

Thanks for the response.

Yes declaring above enums helped.

Are there any other enums ??

Regards,

Pranay

0 Likes

Hi,

Please do refer to Section 4.2 in Power SDK User Guide for some compile time options that you can disable as per your requirement.

Since your device is just a sink. You can clear some functions in psource.c file. Make sure you leave empty function definitions in the file so that the project gets compiled without errors.

Regards,

Pranava

Best regards,
Pranava
0 Likes