CY7111 USBPD_Sink How to send ATTENTION REQ to source?

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
ntsg_hsif
Level 1
Level 1
5 sign-ins First like given First reply posted

I connected CY7111 CC pin to my USB-C board, modified USBPD_SINK example and managed to get Source (PC) to enter DP-ALT mode, but I could not find where to send ATTENTION REQ VDM from SINK, could anyone give some suggestions?

 

Thank you.

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

The API you are using is correct, I think you are calling this command even before there is an actual PD contract.

Please use the following check to make sure that the contract exists before sending VDM.

I have hardcoded data objects for the attention message just to save some time at my end.

cy_stc_pdstack_dpm_pd_cmd_buf_t buf;
cy_stc_pdstack_context_t gl_PdStackPort0Ctx;

buf.cmdSop = CY_PD_SOP;
buf.noOfCmdDo = 2;
buf.cmdDo[0].val = 0xff01a106;
buf.cmdDo[1].val = 0x1a;
buf.timeout = 100u;

if(gl_PdStackPort0Ctx.dpmConfig.contractExist == true)
Cy_PdStack_Dpm_SendPdCommand(&gl_PdStackPort0Ctx, CY_PDSTACK_DPM_CMD_SEND_VDM, &buf, false, NULL);

I was able to send ATTENTION REQ VDM using this. Please try this and let me know the output.  Also if possible please share your entire code so that I can go through it and help you better.

Best regards,
Pranava

View solution in original post

4 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

You can use the same API (Cy_PdStack_Dpm_SendPdCommand()) you used to send other VDM commands to send ATTENTION command as well. Please try and let me know if you need any further information.

Best regards,
Pranava

Dear, thanks for the quick reply.

I modified the firmware based on example (mtb-example-pmg1-usbpd-sink), my system works as DP-ALT sink, so I only modified the function eval_vdm() in vdm.c to ACK and reply to Source device (e.g., PC)'s VDM REQ command.

I know the API Cy_PdStack_Dpm_SendPdCommand() and I tried to use it in main.c when my DP sink is ready (DP HPD is High), but I failed to send VDM REQ command from my CY7111, do you have an example of how to send VDM using this API?

I tried the following, but the return value is 14 which means CY_PDSTACK_STAT_NOT_READY...

pdstatus = Cy_PdStack_Dpm_SendPdCommand(&gl_PdStackPort0Ctx, CY_PDSTACK_DPM_CMD_SEND_VDM, &extd_dpm_buf, false, NULL);

Please help and I will appreciate if you can provide an example of how to send VDM using this API.

 

Thank you so much.

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

The API you are using is correct, I think you are calling this command even before there is an actual PD contract.

Please use the following check to make sure that the contract exists before sending VDM.

I have hardcoded data objects for the attention message just to save some time at my end.

cy_stc_pdstack_dpm_pd_cmd_buf_t buf;
cy_stc_pdstack_context_t gl_PdStackPort0Ctx;

buf.cmdSop = CY_PD_SOP;
buf.noOfCmdDo = 2;
buf.cmdDo[0].val = 0xff01a106;
buf.cmdDo[1].val = 0x1a;
buf.timeout = 100u;

if(gl_PdStackPort0Ctx.dpmConfig.contractExist == true)
Cy_PdStack_Dpm_SendPdCommand(&gl_PdStackPort0Ctx, CY_PDSTACK_DPM_CMD_SEND_VDM, &buf, false, NULL);

I was able to send ATTENTION REQ VDM using this. Please try this and let me know the output.  Also if possible please share your entire code so that I can go through it and help you better.

Best regards,
Pranava

Dear Pranava,

Thanks for the great support, maybe my hardware was unstable for unknown reason, and now I followed your example with my own VDOs, I can send ATTN REQ correctly.

0 Likes