cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 USBPD periphery seems to be deaf

Tadeas_Pilar
Associate II

Hello,
I am developing a USB PD sink application on custom board with STM32G0B1VET
I am using periphery UCPD2. I followed AN5418 to set up eveyrthing in CubeMX and add the specified pieces of code.
Hovewer, ithe USBPD stack doesn't seem to send or recieve anything on the CC1 or CC2 lines. I have confirmed with oscilloscope, data is flowing to the MCU CC2 pin, but nothing seem to happen inside the USB stack.
This is as far as it gets:

Tadeas_Pilar_0-1695580295446.png

With a sniffer device, I can see the power supply sending source capabilities, but these packets are nowhere to be seen when logging the application.
This leads me to believe, the USB PD stack isn't getting the data.
Any ideas where to look for the problem? I have followed the instrucions and I can't see how this could be a electricall issue. 
Firmware package is STM32Cube FW_G0 V1.6.1

Thank you for any help

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tadeas_Pilar
Associate II

Solved it.
Turns out, precise timing is very important. Even though all ST manuals suggest using internal 16MHz RC oscilator, it might not be precise enough. After switching to external crystal oscilator, it started working as expected.

Hope this helps anyone in this situation.
@LLECH.1 please update your manuals to reflect this finding. At least as a debug step. It had cost me 15h of my life to figure out.

Also external pull down resistors don't actually hurt anything and can stay.

View solution in original post

11 REPLIES 11
Imen.D
ST Employee

Hello @Tadeas_Pilar ,

First  let me welcome you to the Community 🙂

I recommend you follow the tips and FAQ described in ST Wiki page. This will help you to start and debug your application.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

I went through that. None of the tips seem applicable to my problems.
I need something more low-level. Some way to check the UPDC perihrey is even alive and reading the data.

Hello @Tadeas_Pilar,

It seems that VBUS is not detected by your sink device. Could you check if 5V is detected on VBUS with USBPD_DPM_IsPowerReady() function please ? What is your hardware setup ? Do you use a TCPP01 shield ? In that case the shield musn't be plugged on the nucleo board since you use UCPD2 instance.  

To help you more efficiently, it would be nice to get your project. Would you provide us your code please?

Best regards,

LECHEVESTRIER Lucas

Tadeas_Pilar
Associate II

I am using custom development board. The CC lines are connected to ground with 4k7 resistors. No other connection to other parts. No protection, no filtering.
USBPD_DPM_IsPowerReady returns USBPD_ENABLE. I am monitoring the Vbus voltage using BSP_USBPD_PWR_VBUSGetVoltage and it returns stable voltage around 4.9V. I believe this part of my project is correct. 
It would be great if you could take a look at my project.
Thank you

 

Hello @Tadeas_Pilar,

I took a look on your project and it seems you forget to add some pieces of code. For example, USBPD_DPM_SNK_EvaluateCapabilities() function should be completed as indicated in AN5418

Also you don't need to add additional 4k7 resistors on your custom board since they are included in UCPD IP, you just need to configure those resistors. 

Best regards,

LECHEVESTRIER Lucas

 

 

 

 

 

I had USBPD_DPM_SNK_EvaluateCapabilities() implemented before. Probably got lost in some of the numerous CubeMX code generations.
But it never gets called. You can see in the log in my original post, it never writes "ADVICE: update USBPD_DPM_SNK_EvaluateCapabilities"

LLECH.1
ST Employee

What about resistors ? Do you have additional resistors on your board ? It should not be the case.

Best regards,

LECHEVESTRIER Lucas

 

 

 

 

Did you follow this wiki : Make a Power Delivery Sink 

It is a useful page to help you to build your own Sink device.  

Best regards,

LECHEVESTRIER Lucas

The CC1 and CC2 lines are connected like this

Tadeas_Pilar_0-1695919466992.png