- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
ispn:35881:1:0
-
l1:314:1:0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Pranava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Pranava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Pranava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.