Skip navigation
Home > All Places > USB > EZ-PD Type-C USB > Blog > Authors YiZ_31

EZ-PD Type-C USB

3 Posts authored by: YiZ_31 Moderator

CYPD3177(BCR) has provided four sets of resistor divider networks are used to determine the voltage and current range that the EZ-PD BCR device will negotiate

with the USB Type-C power adapter. However, if it still cannot meet your requirement, you can change the PDO through its I2C register.

 

This blog gives a breif introduction on how to change the BCR register based on BCR HPI Spec.

1. Hardware Connection

Figure 1

Connect SCLK and SDAT of MiniProg to CY4533 as is shown in Figure 1. Set the rotary switch (SW1) to position 1 so CY4533 support 5V/0.9A by default. Use a CY4500 EZ-PD Protocol Analyzer to capture the cc communication between CY4533 and the power adapter.

 

Figure 2

As is shown in Figure 2, CY4533 request 5V/0.9A due to the max requesting VBUS set by rotary switch is 5V/0.9A.

2. Send I2C command in Bridge Control Panel to control BCR

Figure 3

Check the PD_STATUS register first. The value of PD_STATUS register is 00 A4 05 00. It means the explicit contract has been established between BCR and the charger. BCR is acting as a power sink and the two device both supports PD 3.0. To replace the default sink PDO, write the corresponding packet into the data memory start from 0x1800. For Byte 0-3, ASCII string “SNKP” (i.e 0x50 0x4B 0x4E 0x53) must be sent to make BCR update its sink PDO list. In this example, PDO 0 is set to 5V/0.9A and PDO 1 is set to 15V/1.75A. The remaining bytes are set to 0 because not all 7 PDOs are used.  Refer to Section 6.4 of Universal Serial Bus Power Delivery Specification for the description of Fixed Supply PDO. Figure 3 is the I2C commands sent and response from BCR.

Figure 4

After enabling the PDO0 and PDO1 mask by sending command to SELECT_SINK_PDO register, BCR will re-negotiate the PD contract with the power adapter. PD_RESPONSE register should be checked after sending command on command registers. 0x02 is the code for successful operation.CC communication is captured by CY4500 in Figure 4.

 

YiZ_31

Post_build Script Failure

Posted by YiZ_31 Moderator Aug 13, 2019

When using PSoC Creator compiling a new project generated from CCGx Host SDK, you could meet such error:

 

"Post-Build Script failed: Primary and backup binaries are overlapping."

The command '.\post_build.bat' failed with exit code '1'.

--------------- Rebuild Failed: 08/13/2019 15:50:15 ---------------

 

There are two ways to avoid this problem.

  • Creating Project from Start Page

The SDK example projects are listed underKits -> EZ PD CCG CCGx Host SDK on the Start Page. Click on the workspace name to copy it. When copying the workspace, the complete workspace directory along with all the projects associated with the workspace are copied to the selected destination location. PSoC Creator automatically opens the copied workspace after completing the copy.

In this way, the Post-Build Script failure problem could be avoided, but the project name could not be changed.

  • Creating Project from Code Examples
  1. Use File->New->Project to create a new project. Modify the workspace name and project name to whatever you want.
  2. Right click on workspace name and use Add a Existing Project to add backup_fw.cyprj to the workspace.
  3. Right-click on workspace name and use Dependencies to add a code dependency for the CYPD3125-40LQXI_notebook project on the backup_fw project.

    4. Edit the post_build.bat script file in the project folder. Change CYPD3125-40LQXI_notebook in @set "PROJ=CYPD3125-40LQXI_notebook" to your project name.

Take CYPD3125 for example. Here are the steps to change it to CYPD3123:

1.Right click on Project ‘CYPD-3125-40LQXI_notebook01’ [CYPD-3125-40LQXIT] and choose Device Selector…

Change the part number from CYPD3125-40LQXIT to CYPD3123-40LQXIT

2. TopDesign.cysch page, double click on Bootloadable_1 component. Click on Dependencies tab and change the path of Bootloader HEX file. The bootloader file of CYPD3123-40LQXIT can be found in “C:\Program Files (x86)\Cypress\EZ-PD CCGx SDK\CCG3-CCG4\Firmware\projects\CYPD3123-40LQXI_ctd_us\CYPD3123-40LQXI_ctd_us.cydsn\Bootloader”. The Bootloader ELF file path will be changed automatically when Bootloader HEX file path has been modified.

3.Compile the project.

 

The project still uses the USB bootloader of the CYPD3123. If you want a CYPD3123 project with I2C bootloader, then you’ll need project file for the bootloader of CYPD3125 (which is not included in the current version of SDK). Change the device part number with the same steps above, then use the generated HEX file for bootloader dependency.

Filter Blog

By date:
By tag: