USB EZ-PD™ Type-C Forum Discussions
Hi,
I add the two commands (bold in below) in function "dock_port_type_role_monitor()" called by while(1) in main(). the 1st command is to turn on a MOSFET switch and the 2nd to send a PR_SWAP command to a Samsung phone in the USB-C connector.
After Samsung plugged I found the 1st command works but the 2nd command does not. The Samsung is not changed to being charged. Could you tell me why and how to make it work?
The dock_port_type_role_monitor() is posted by LisaZ_26 in the previous post in the forum. The main.c is at attached.
void dock_port_type_role_monitor()
{
const dpm_status_t* dpm_stat = dpm_get_info(0);
if(!(dpm_stat->attach))
{
dock_port_monitor_state = 0;
}
switch(dock_port_monitor_state)
{
case 0:
if((dpm_stat->attach) && (dpm_stat->contract_exist)){
dock_port_monitor_state = 1;
ds_flag = 0;
ps_flag = 0;
}
break;
case 1:
if(!timer_is_running(0,PORT_CHG_RETRY_TMR)){
if((dpm_stat->cur_port_role == PRT_ROLE_SINK) && (ps_flag < 3))
{
if(dpm_pd_command(0,DPM_CMD_SEND_PR_SWAP,NULL,ps_cbk) != CCG_STAT_SUCCESS)
{
timer_start(0,PORT_CHG_RETRY_TMR,PORT_CHG_RETRY_TMR_PERIOD,NULL);
}
}
if((dpm_stat->cur_port_type == PRT_TYPE_DFP) && (ds_flag < 3))
{
if(dpm_pd_command(0,DPM_CMD_SEND_DR_SWAP,NULL,ds_cbk) != CCG_STAT_SUCCESS)
{
timer_start(0,PORT_CHG_RETRY_TMR,PORT_CHG_RETRY_TMR_PERIOD,NULL);
}
}
}
USB_SWITCH_CTRL_Write(0);
CyDelayUs(100);
// pd_prot_send_ctrl_msg(0,SOP,CTRL_MSG_PR_SWAP);
dpm_pd_command (TYPEC_PORT_0_IDX, DPM_CMD_SEND_PR_SWAP, NULL, NULL);
CyDelayUs(100);
break;
}
}
Thanks,
Derong Yuan
Show LessI am trying to add a command in the source code of the reference project "CYPD3120-40LQXI_dp_dongle" to turn on/off a GPIO port of CYPD3123 when a device is detected plugged in the USB-C. Can anyone tell me the command and the source code name in the project?
Thanks,
Derogn Yuan
Show LessI tested my chip cypd3125 by cy4531, and I could use PSoC programer to program/read firmware in my chip by SWD using MiniProg3. And then I put the cypd3125 in my demo power adapter, and SWD pins connect the typec pins to ensure I can connect it by typec line. However I can't connect the cypd3125 by SWD(I use vbus pin to power),what's the difference between cy4531 and my demo power adapter? thanks.
Show LessHi,
I programmed a CYPD3125-40LQXI with the hex code from a reference project "CYPD3125-40LQXI_notebook", then powered my project board with an external 5v and 3v power supply. The VBUS power is not used in the project board.
The project board has the CYPD3125 and a USB hub circuit. The USB hub's upstream port is connected to the USB2.0 DP1 and DN1 in the USB-C connector.
Then I connect the USB-C connector in the project board to a laptop computer's USB-C connector, I found the USB hub is not working correctly (but looks like receiving signals from the laptop as the USB hub's LED keeps flashing) . I also found the VBUS_P_CTRL0 and VBUS_P_CTRL1 changed output voltage from 3.6v to 4.4v.
I checked the USB hub circuit by connecting the USB hub's upstream port to a USB A port in a desk top computer. It works perfectly.
Please advise why the firmware of the reference project does not work.
Thanks,
Derong Yuan
Show LessHi,
I have designed a circuit with CYPD3125, a Dp-to-HDMI converter, a USB hub controller and a DC power regulator. The PCB is ready but later found the SDK project "CYPD3120-40LQXI_dp_dongle" firmware can not be changed for CYPD3125 controller but can be changed for CYPD3123 controller. I do not see the functional difference between two controller but can anyone tell me if I can use CYPD3123 to replace the CYPD3125 for my application circuit below:
1. The upstream signals DRX0P,DRX0N, DRX1P,DRX1N, DRX2P,DRX2N, DRX3P,DRX3N of the Dp-to-HDMI converter are directly connected to a USB-C connector but the signals AUXP, AUXN of the Dp-to-HDMI converter are connected through CYPD3125 to the USB-C connector.
pin 11 of CYPD3125 ----------------->AUXP
pin14 of CYPD3125 ----------------->AUXN
pin12 of CYPD3125 <----------------SBU1 (pin A8) of USB-C
pin13 of CYPD3125 <----------------SBU2 (pin B8) of USB-C
2. D+ (pin 21) ,D- (pin 22) of CYPD3125 are connected to a USB hub downstream port. The upstream port of the USB hub is connected to DP (A6), DN (A7) of the USB-C
3. the USB hub controller, Dp-to-HDMI converter and CYPD3125 are powered by an external power supply and must be turned on before connecting to USB-C connector.
4. CYPD3125 needs to talk with a smart phone plugged in the USB-C and let the phone to transmit video through the Dp-to-HDMI converter.
5. CYPD3125 turns on an NMOSFET to charge the smart phone.
Thanks,
Derong Yuan
Show Less
What's the slave address of CCG3' I2C2 port(GPIO3.4、GPIO3.5),when used as slave I2c?
Hello
Once the sample FW is written to the CY4532 kit, the connetione will not be 2 as attached.(USB Type-A to Micro-B) cable connected to J12 on the CY4532 EVK power Bard). Q)How can I return CY4532 to its initial state?I want to return to the same state as attached
Best Regards
Arai
Show LessHi,
In PSoC Creator 3.3 I tried to change the device name in the project "CYPD3120-40LQXI_dp_dongle" from CYPD3120-40LQXIT to CYPD3125-40LQXIT I got the following error message in building:
1. pft.M0076: The selected device for the Bootloader and Bootloadable projects must match, but don't. Bootloader is targeting 'CYPD3120-40LQXIT' and Bootloadable is targeting 'CYPD3125-40LQXIT'.
2. cdf.M0005: CyDsFit aborted due to error, please address all errors and rerun CyDsFit.
I found somebody else had the same problem in the Cypress forum and was told to "Change in your bootloadable the reference."
Could you please advise how to make the change?
Also I found the file boot.h has an error in 258 line: bool boot_start(void); Could you tell me if it is a wrong file?
The project "CYPD3120-40LQXI_dp_dongle" is downloaded from Cypress website.
Thanks,
Derong Yuan
Show Less