cancel
Showing results for 
Search instead for 
Did you mean: 

USB-PD attention callback never get's triggered?

Brenden_PLUS
Associate III

Problem 

When i call 

* USBPD_PE_SVDM_RequestAttention

I get a OK message response but the callback never gets called.  

* USBPD_VDM_SendAttention

 

Curious to know if there's any good way to debug this? 

 

Current debugging steps

I have a STM32G0-Disco board setup to capture the messages over USB-PD and display them with ST's USB-PD monitoring software.  So i know the attention pin is not currently activating.  I have a breakpoint to make sure that USBPD_PE_SVDM_RequestAttention is being called.  If i wait a few seconds and then trigger it to call USBPD_PE_SVDM_RequestAttention again i get a BUSY error.  So i figure it's trying to send it, it just can't?

 

 

My project

I'm using this as my base with a stm32G071- nucleo board.  I grab the CC lines from usb with a breakout board that passes the USB datalines through.  

https://github.com/STMicroelectronics/STM32CubeG0/tree/master/Projects/STM32G081B-EVAL/Applications/USB-PD/USB-PD_Consumer_1port

And i'm migrating all the USB-PD calls that relate to Display Port/VDM  over from this project

https://github.com/STMicroelectronics/STM32CubeG0/tree/master/Projects/STM32G081B-EVAL/Demonstrations/DemoUCPD

 

PD captures

 

Current2.png

 

Current capture.png

 

 

 

Screenshot 2025-12-21 at 10.12.14 AM.png

Screenshot 2025-12-21 at 10.01.39 AM.png

5 REPLIES 5
FBL
ST Employee

Hello @Brenden_PLUS 

Thank you for your feedback!

Would you check if the callbacks are properly implemented as in G0 demo?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL

So i call the function USBPD_PE_SVDM_RequestAttention.

 

But it never fires the callback USBPD_VDM_SendAttention.  

https://github.com/STMicroelectronics/STM32CubeG0/blob/24d13255ffa4eca73d133561a3df72f7df90d302/Projects/STM32G0C1E-EV/Demonstrations/Modules/ucpd/usbpd_vdm_user.c#L550

 

 

I thank you for your support, but i'll be on vacation till January 15.  @FBL you been a huge help for me to figure out USB PD with the stm32.  

 

FBL
ST Employee

Thank you @Brenden_PLUS  It 's a pleasure to support you ! Enjoy your vacation.

Attention message can only be sent after a successful USB PD explicit contract and after entering the DisplayPort Alternate Mode. When HPD pin is low, and mode is not entered, the stack may silently ignore or queue the Attention message without sending. 

I found also according to USB Type-C™ and Power Delivery DisplayPort Alternate Mode, section 4.6, an Attention message with IRQ set to 1 marks the end of USB PD DP Alternate Mode communication and the
beginning of standard DP operation, when all the DP signals are mapped to the Type-C connections.

An internal ticket 224463 is submitted to dedicated team for any insights into internal precompiled library management of USBPD_PE_SVDM_RequestAttention.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.




Best regards,
FBL

So does the internal UCPD hardware block have the ability to detect voltage level.  

 

I'm fairly certain i'm in a explicit contract since i've entered the mode and have setup the thing to do Display port.  

 

So the only reason from a pure signal perspective that would cause it to not work is if the voltage level was wrong or it wasn't setup properly to read the voltage level.  

 

In the code i'm working on i removed the ADC channels that all the examples had.  So usually there's a VBUS sense and a ISense in the examples.  Which i don't think really matter for my case since i actually don't want to change the voltage away from just a standard 5v signal.  

 

I'm fairly curtain it must have the ability to measure the voltage, but just checking.  

 

So this is what the transaction looks like and it seems like it does find it's resting voltage.  So i should be able to send a attention without problems.  Granted it rest at like 0.8V which seems kind of low.  The data range is 0-1.0v.  

Measurment_PD_signal.png

Brenden_PLUS
Associate III

Problem.

  • So i had Dead battery enabled but i wasn't connecting it up.  
  • Instead i was using 5.1KOhm resisters attached to CC lines.  

 

Working Signal .png

Thing to note are that by default the dead battery pins are set to the resister for 1.5 amps.  But in the demo code i think they must be setting them to the 3.0 amps resister.  I'm going to continue to leave this post open  until i fully understand why this worked?