By default, HPI in the source code is disabled, since CCG2 has a small flash and inclusion of HPI might leave less space for customization.
If you can optimize your code and include HPI, you can enable it in this location -
In the 'usbpd.h' file, you find this:
/* HPI Configuration
#define HPI_CONFIGURATION (HPI_NOT_SUPPORTED)
You have to change (HPI_NOT_SUPPORTED) to (HPI_SUPPORTED)
After this you can build your application as before and program the device. Be sure to optimize the code and not run out of flash size.
Thanks, Rajath. I will try it. By the way, the CCG2 60W car charger reference design use CYPD2134-24LQXI, can I replace with CYPD2122-24LQXIT, are they compatible in hardware and firmware at car charger reference design?
2122 will have DRP application, which means it supports alternate mode and can be negotiated for sinking power. On the other hand 2134 is only for providing power. Though you can use 2122 in place of 2134, it will have less space for customization. Hence it is recommended to use 2134.
Just a thought here: In our project we have both implemented a custom DC/DC IC and are using the HPI interface, but we are controlling the DC/DC directly from the CCG4 (in our case) using I2C. IMHO it will be very complicated to control the DC/DC through the HPI since I'm not sure you get all the required events and it will be tricky to manage the state-machine between different ICs that you will have.
I think you should first really consider if it is not possible to control the DC/DC directly by the CCG2 via I2C as you have in the default source code for the car charger. Or you can use the I2C master block that is used to control the DC/DC and instead communicate to your MCU. Going via the HPI i/f will be a complicated strategy I believe.
Just 2 cents
You did not answer my question. I need to know how to fix these two compile error?
I compile with (HPI_NOT_SUPPORTED), generate two hex file, there are CYPD2134-24LQXI_PA_NCP82139.hex and cc_boot-pa.hex. I program by CY8CKIT-002 MiniProg3 to CCG2+NCP81239 reference design with CYPD2134-24LQXI_PA_NCP82139.hex file, the CCG2+NCP81239 reference design do not work, program with cc_boot-pa.hex, the CCG2+NCP81239 reference design only output with 5V 0.5A power rail, what was I mistake?
Could you give me the hex file for the latest version FW of CCG2+NCP81239 reference design for I program the reference design and make it work normal?
1. I guess Rajath have shared latest SDK project to you before as per your description in this thread, so the latest HEX file you have already on your hands. You can get it after you build the project with PSoC Creator 3.3 DP1 without any changes. I also attached it for your reference. Or you can use the HEX attached in the link: http://www.cypress.com/documentation/reference-designs/ccg2-60w-car-charger-reference-design
2. As per your description about the test results after programmed cc_boot-pa.hex , the Type-C port have 5V/500mA out on your end after attached Type-C device. If you could like to debug why 5V voltage on VBUS, I would like recommend you to test below points:
Pin#15 of CCG2 (J13) : Check whether it is HIGH or LOW. If you only programmed bootloader file, this point shall be unstable states.
Pin#19 and pin#20 of CCG2 (J12): Check whether there is I2C interactions under this condition.
3. For your original concerns about HPI.
>> The SDK project for CYPD2134 is not enabled HPI. If you want to enable HPI, to be more convenience, recommend you use CYPD2122 example project, the HPI have been enabled. Please kindly noticed CCG2+NCP81239 car charger reference design have additional I2C master in the project.
>> If you want to try to disable HPI in CYPD2122 to see what is difference, you can refer link: Simple CCG2 example firmware for power bank
1. It is strange that I program several times on last Friday, the CCG2+NCP81239 do not work, but today it become normally.
2. The two compile error with HPI_SUPPORTED also disappear.
I am glad to hear that the issue was resolved.
I have been met some issue if the compiler setting is not correct. Just for your reference.