Logging Events Received in CC3PA

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
PrRe_3492461
Level 4
Level 4
First like received 50 sign-ins 50 replies posted

Hello Cypress community,

I'm using ccg3pa for my development.

Whenever a PDC happens I'm able to log Events received by ccg3pa by Filling a logger in "app_event_handler()" @app.c file.

So There is "APP_EVT_PKT_RCVD" event occuring for PD packet received.

Do we have any provision to find out whether what kind of packet is received ?

For Example:

We initiated Request packet with PDO with Max.operating and Operating current which DUT doesn't support, in this case DUT responds with Reject which is expected.

So How would I come to know whether DUT Rejected/Accepted my last Requested PDO and take a call based on that? How would I achieve this requirement?

Regards,

Pranay.

0 Likes
1 Solution
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi Pranay,

You can use the app_evt_handler() API for checking UVDM response too. The event PKT_RCVD can be used to identify what packet has been recieved.

For additional info, the function eval_vdm() in vdm.c will be used to process recieved UVDM's. When PKT_RCVD event occurs, the parameter void *dat contains pd_packet_extd_t* formatted received data (VDO).

Regards,

Rajath

View solution in original post

0 Likes
8 Replies
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi Pranay,

Sorry for the delay in responding. In the 'app_event_handler' API, you have a case (APP_EVT_PKT_RCVD).

This is disabled by default. if you enable this, you can add an API to check the packet recieved. For example, if msg_type is CTRL_MSG_REJECT, the packet received is 'Reject'.

Regards,

Rajath

Hello RajathB_01​,

By Configuring ccg3pa as Sink and after initiating an UVDM, If DUT responds How would I track the respose.

What is the expected sequence of code flow for an UVDM response ?

Regards,

Pranay.

0 Likes

Hi Pranay,

Which is the API you are using to send UVDM's?

Regards,

Rajath

0 Likes

"dpm_pd_command(G_PORT0, DPM_CMD_SEND_VDM,&VDM_cmd_buf, NULL);"

This is the API I'm using to initiate UVDM by making

VDM_cmd_buf.cmd_do[index].ustd_vdm_hdr.cmd_type = CMD_TYPE_INITIATOR;
VDM_cmd_buf.cmd_do[index].ustd_vdm_hdr.cmd = VDM_CMD_DSC_IDENTITY;
VDM_cmd_buf.cmd_do[index].ustd_vdm_hdr.vdm_type = VDM_TYPE_UNSTRUCTURED;

Question 1:

with above configuration I'm able to initiate uvdm, but need to track response.

That means DUT is responding with below VDOs, I need to decode and check for DUTs response.

How I achieve this ?

How would I decode DUTs UVDM response ?

pastedImage_0.png

Question 2:

In the screenshot below, I want to change "Available for Vendor use" field which is from bits[14:0] in Each Dataobject.

How do I configure the b[14:0] bits in each Data object ??

can you please point me out to the API if any available.

pastedImage_0.png

Thanks & Regards,

Pranay.

0 Likes

Hi Pranay,

Have you tried the uvdm_handler API?

uvdm_response_state_t uvdm_handle_cmd(uint32_t *rx_pkt, pd_do_t **vdm_rspn_pkt, uint8_t *vdo_count, flash_cbk_t flash_cb)

Regards,

Rajath

0 Likes

Hi Rajath,

You mean for initiating uVDM? No I didn't tried and Can we initiate using this COmmand ??

But when uVDM response is received I Kept breakpoint in uvdm_handle_cmd() function but it is not hitting.

can you try this on your end and let me know the sequence flow ?

Regards,

Pranay.

-


On Thu, 02 Jul 2020 16:33:13 +0530 RajathB_01 <community-manager@cypress.com> wrote -


http://www.cypress.com

https://community.cypress.com/?et=watches.email.thread

Logging Events Received in CC3PA

reply from https://community.cypress.com/people/RajathB_01?et=watches.email.thread in EZ-PD Type-C USB - https://community.cypress.com/message/241437?et=watches.email.thread#241437

Hi Pranay,

 

Have you tried the uvdm_handler API?

 

uvdm_response_state_t uvdm_handle_cmd(uint32_t *rx_pkt, pd_do_t **vdm_rspn_pkt, uint8_t *vdo_count, flash_cbk_t flash_cb)

 

Regards,

Rajath

Reply to this message by replying to this email, or https://community.cypress.com/message/241437?et=watches.email.thread#241437

Start a new discussion in EZ-PD Type-C USB by mailto:discussions-community-productforums-usb-ezpdtypec--usb@broadcomwiced-v8.hosted.jivesoftware.com or at https://community.cypress.com/choose-container.jspa?contentType=1&containerType=14&container=2261&et=watches.email.thread

Following https://community.cypress.com/message/241437?et=watches.email.thread#241437 in these streams:

Inbox

This email was sent by Cypress Developer Community because you are a registered user.

You may https://community.cypress.com/unsubscribe.jspa?email=pranay%40graniteriverlabs.in&token=0d7b2fdac2470c62213b6e2bad37147ce0c7fe09e0bf80fd6ab2a318cc92c26f instantly from Cypress Developer Community, or adjust email frequency in your https://community.cypress.com/user-preferences!input.jspa

0 Likes

Hi Pranay,

You mean for initiating uVDM? No I didn't tried and Can we initiate using this COmmand ??

No, I was talking about tracking recieved UVDM response using this api.

But when uVDM response is received I Kept breakpoint in uvdm_handle_cmd() function but it is not hitting.

Okay, I will check about this.

Regards,

Rajath

0 Likes
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi Pranay,

You can use the app_evt_handler() API for checking UVDM response too. The event PKT_RCVD can be used to identify what packet has been recieved.

For additional info, the function eval_vdm() in vdm.c will be used to process recieved UVDM's. When PKT_RCVD event occurs, the parameter void *dat contains pd_packet_extd_t* formatted received data (VDO).

Regards,

Rajath

0 Likes