cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD™ Type-C

Anonymous
Not applicable

I'm trying to use the EZ-PD configuration utility to generate the .c config file to use in PSoC 3.3 for programming a CCG2 over SWD w/ MiniProg3.

The API guide says the following...

3. Use the EZ-PD Configuration Utility to build the configuration table, and copy the generated C source file into the Creator

project if necessary. The configuration table can also be updated by editing the usbpd_config.c file in PSoC Creator Source

Editor.

3.1. The configuration table is part of bootloader project. Build bootloader project using the PSoC Creator.

I have generated the config table in .c format, but I am stuck on how to import it correctly in the PSoC Creator project. That files calls a "pd.h", which I have not found anywhere and has functions that do not exist in any other header files. There is a note in the generated configuration table .c file that says...

     "The config table should be placed in the "configSection" so that the update tools can correctly retrieve the data."

Does this mean it should be placed in the config folder in the power_adapter tree? I don't see configSection anywhere else; the config folder is the closest I see to that.

I have also tried just replacing the configuration table in the power_adapter config.c file with the newly generated one, but that did not seem to work.

Any help is appreciated, thanks.

0 Likes
1 Solution
ShifangZ_26
Moderator
Moderator

Hi Andrew,

You need re-build cc_boot-pa project after update usbpd_config.c. The cc_boot-pa project is not opened in Creator project, you have to add it into project manually. You can find the project under folder shows as below. You can get the elf and hex files which was generated by cc_boot-pa project under folder: ...\CCG2_SDK_2134\CYPD2134-24LQXI_power_adapter\CYPD2134-24LQXI_power_adapter.cydsn\cc_boot-pa.cydsn\CortexM0\ARM_GCC_493\Debug

pastedImage_0.png

After re-build this project, you need go to CYPD2134-24LQXI_power_adapter project, and click TopDesign.cywk. You can find the bootloadable component and update the elf and hex files which was generated by cc_boot-pa project above.

pastedImage_1.png

And then, you can re-build the CYPD2134-24LQXI_power_adapter project to get the HEX file under folder:...\CYPD2134-24LQXI_power_adapter\CYPD2134-24LQXI_power_adapter.cydsn\CortexM0\ARM_MDK_Generic\Debug

Best Regards,

Lisa

View solution in original post

0 Likes
7 Replies
RajathB_01
Moderator
Moderator

Hi Andrew,

Please refer this existing thread - CCG2 CCG3 how to edit PDO data in configuration table with PSoC creator .

I hope this will answer your questions.

Regards,

Rajath

Anonymous
Not applicable

Thank you, Rajath, that is very helpful.

I've followed those explanations and still have issues. When I take the power_adapter example pre-generated hex file from the sdk I can load it to my board and see that it offers 5V @ 500mA, but if I recompile the power_adapter example without changing any code and generate a new hex file it no longer shows any communication in the EZ-PD Analyzer Utility. I'm not sure why this is since none of the code has changed.

When I create a new project from the power_adapter example and generate the hex file it also does not offer any messages when plugged in. Even taking this hex file into the EZ-PD configuration utility and modifying the PDOs, the board still does not offer any messages when plugged in.

Any idea what the issue may be?


Thanks.

0 Likes
ShifangZ_26
Moderator
Moderator

Hi Andrew,

Attention: CCG2 project should update bootoloder project first. And then update bootloader file in application project bootloadable component and then rebuild application project.

​Best Regards,

Lisa

0 Likes
Anonymous
Not applicable

Thanks Lisa,

These are the steps I'm following:

  1. Create configuration table using EZ-PD Configuration Utility CCG2 Power Adapter template
    1. Change nothing to get PDOs 5V, 9V, 15V, and 20V
    2. Save .c, .xml, & .cyacd
  2. Open power_adapter example from Cypress SDK and locate usbpd_config.c
    1. Copy and paste the configuration table from step 1 over the existing table
  3. Open power_adapter example from Cypress SDK and go to ‘Build’ -> ‘Clean and Build …’
  4. Locate generated hex & elf files in ‘… CortexM0’ -> ‘ARM_MDK_Generic’ -> ‘Debug’
  5. Copy and move the generated hex & elf files to the Bootloader folder and rename to match the existing file names in the folder (and double check that it matches the name of the dependencies in the ‘Bootloadable’ component in the TopDesign
  6. Open power_Adapter example from Cypress SDK and go to ‘Build’ -> ‘Generate Application’

At this point in the Power Adapter Reference Design and API Guide it says Build the application project using the PSoC Creator. The firmware binaries will be generated in ELF, HEX and CYACD formats suitable for SWD programming or loading through JTAG, Miniprog3 and the EZ-PD configuration utility.” However, I do not see where these firmware binaries have been created. The only hex and elf files I can find seem to be those generated in Step 3 ‘Build’ -> ‘Clean and Build’ above as they have the old timestamp.

0 Likes
RajathB_01
Moderator
Moderator

Hi Andrew,

'Generate Application' will generate the application source files (.c and .h)

'Build / Clean and Build' are the only options which generate binaries.

In step 6, please replace 'Generate Application' with 'Build'.

Regards,

Rajath

0 Likes
Anonymous
Not applicable

Thanks Rajath,

Following the steps above I now get Error: L6221E where the bootloader and application overlap. After researching a bit it seems that this is a problem with the Keil ARM. Any ideas on how to fix this?

pastedImage_0.pngpastedImage_1.png

0 Likes
ShifangZ_26
Moderator
Moderator

Hi Andrew,

You need re-build cc_boot-pa project after update usbpd_config.c. The cc_boot-pa project is not opened in Creator project, you have to add it into project manually. You can find the project under folder shows as below. You can get the elf and hex files which was generated by cc_boot-pa project under folder: ...\CCG2_SDK_2134\CYPD2134-24LQXI_power_adapter\CYPD2134-24LQXI_power_adapter.cydsn\cc_boot-pa.cydsn\CortexM0\ARM_GCC_493\Debug

pastedImage_0.png

After re-build this project, you need go to CYPD2134-24LQXI_power_adapter project, and click TopDesign.cywk. You can find the bootloadable component and update the elf and hex files which was generated by cc_boot-pa project above.

pastedImage_1.png

And then, you can re-build the CYPD2134-24LQXI_power_adapter project to get the HEX file under folder:...\CYPD2134-24LQXI_power_adapter\CYPD2134-24LQXI_power_adapter.cydsn\CortexM0\ARM_MDK_Generic\Debug

Best Regards,

Lisa

View solution in original post

0 Likes