Changing CYPD2122-24LQXIT configuration

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
whalen
Level 1
Level 1
First reply posted First question asked Welcome!

I am attempting to change the config to the pd2122 so it will configure an android phone to be a "down facing port" but charge through the USBC connection.  I was recommended to use the CYPD2122-24LQXIT Notepad project to generate the c file to access the required config table.  This has not worked so I'm asking what I'm doing wrong.  Here is what has not worked

  1. With EZ-PD Configuration Utility open the CCG2 CYPD2122-24LQXIT Notepad project and save it. 
  2. This creates the notepad.c file containing the gl_config_table
  3. With PSoC Creator, drill down to EZ-PD CCGx SDK->CCG2->Firmware->projects->CYPD2122-24LQXIT-notebook project
  4. Copy gl_config_table data to usbpd_config.c that resides in the i2c_boot_nb project that resides in the CYPD2122-24LQXIT-notebook project
  5. Build the project which creates notebook.elf, notebook.hex, i2c_boot-nb.elf, i2c_boot_nb.hex
  6. Flash the chip with the notebook.hex 

The result is the phone does charge but it's a "up facing port" not a "down facing port" ?????

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

Hello Whalen,

Please attach the PD logs captured using an analyzer for our reference.

The i2c_boot_nb project is the I2C bootloader project which is included as part of the bootloadable component in the notebook application project. To update the configuration, we need to update the usbpd_config.c file in the bootloader project, build it, and then update the .hex and .elf files in the bootloadable component in the notebook project. This would update the configuration in the .hex that is generated after building the notebook project. Please refer to the KBA for complete steps.

Best Regards,
Sananya

View solution in original post

0 Likes
5 Replies
Sananya_14
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

The steps you used to change the configuration is correct. However, please note that as per the Type-C Spec, the initial configuration of a device will be either a DFP, source or UFP, sink. So, if your phone is charging, it would be in the UFP, sink configuration initially and to make it a DFP, you would have to initiate a PD DR_Swap to your port partner. You could add this as shown in the code snippet below-

if((get_current_port_role() == PRT_ROLE_SINK) )
{
handle_pd_command (DPM_CMD_DR_SWAP, NULL, NULL);
}

Please mention if you have made any other changes other than the port role in the configuration.

Best Regards,
Sananya

0 Likes

Sananya,

Thanks for the reply.  Do I insert this code snippet in the Notebook main.c after the system_init() call?

thanks

Whalen

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

Hello Whalen,

Please try adding it at the end of the while(1) in main() with a retry count to ensure its not sent repeatedly.

Please also add a check for the PD contract being successful before the code snippet as shown below-

if((get_contract_status()==1)&&(get_current_port_role() == PRT_ROLE_SINK))

Best Regards,

Sananya

0 Likes

Still not working ... below is what I have added to the bottom of the notebook project main.c loop

what is the purpose of the i2c_boot_nb project?  This is where I pasted the gl_config_table array but its the notebook project image that is loaded to the chip?

if((get_contract_status()==1)&&(get_currehere nt_port_role() == PRT_ROLE_SINK) && (retry < 5)) {

retry++;
handle_pd_command (DPM_CMD_PR_SWAP, NULL, NULL);
}

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

Hello Whalen,

Please attach the PD logs captured using an analyzer for our reference.

The i2c_boot_nb project is the I2C bootloader project which is included as part of the bootloadable component in the notebook application project. To update the configuration, we need to update the usbpd_config.c file in the bootloader project, build it, and then update the .hex and .elf files in the bootloadable component in the notebook project. This would update the configuration in the .hex that is generated after building the notebook project. Please refer to the KBA for complete steps.

Best Regards,
Sananya

0 Likes