cancel
Showing results for 
Search instead for 
Did you mean: 

USBPD CC orientation STM32G071RB

josemdq
Associate II

Hi, I am troubleshooting a custom board using USBPD as sink.

 

It only negotiates a PDO on one orientation of the USBC connector.

Checked with an oscilloscope and I see waveform going to CC1 on the orientation that works , naturally, and changing orientation I see a waveform going to CC2 but it does not negotiate on this side.

 


I know the signal goes to CC2's pin. The pin is configured in STM32CubeIDE as UCPD_CC2 and set to analog mode.

 

The cable detection feature also does not work to detect dettach events.

Any advice appreciated. Using 4.1.0 TCPP library version. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi, ok, I think the problem is solved.

Thanks for that pointer to the ADC. During my debugging session I saw the library constantly executing the function you pointed to after connecting the USBC port.

After adding the voltage divider and configuring the ADC properly both orientations work without resetting the MCU.

Before I was also not getting cable detach traces. Now I do see them.

I would say that without the ADC it would never realize the cable was detached and kept CC1/CC2 configuration from the first negotiation.

Regards, Jose

View solution in original post

10 REPLIES 10
BarryWhit
Lead II

Can you show the schematic? 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

josemdq_1-1723771453805.png

 

josemdq_0-1723771261177.png

We are transitioning from FUSB302 PD controller. Right now we have the same DNP config as schematic for jumper selection of STM32 UCPD controller.

 

BarryWhit
Lead II

Do you have Capacitors on CC1c/CC2c as per datasheet section 6.6.4 "CC line capacitance (C1, C2)"? (probably not the issue)

 

Where did you probe with the scope - on the connector pin side or on the MCU pin side? Did you probe on the MCU pin itself or near it?

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.
josemdq
Associate II

I don't have caps on the CC1c/CC2c.

 

I have probed on the MCU pin itself. The waveform looks the same as the signal on CC1 when I change connector orientation. Seems like the DFP keeps sending packets but MCU does not respond.

 

 

BarryWhit
Lead II

You can try and follow

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink#-5BOPTIONAL--Configure_Tracer_for_debug

Which describes how to set up PD for tracing/debugging with UCPD monitor, so you can see if the STM32 is seeing the messages from the DFP.

(note other related wiki articles on different PD roles appear in the TOC on the left)

 

Please post an update if you make progress figuring it out.

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

Hi Barry, thanks. I found something interesting.

 

If a do an MCU reset in between orientation flips it always works.

After a successful negotiation it will only work on that orientation until I restart the MCU, which makes me think maybe my code is missing something? Does the ST library expect a command after an unplug event to prepare for the next negotiation?

BarryWhit
Lead II

ah, progress indeed.

 

I'm not sure what it expects. A quick look found this in one of the example projects where the detach event code isn't auto-generated. I have no idea what (if anything) depends on this, but you could try to chase it up the call chain and see

 

Did you base your app on one of the existing example projects in the Cube Package? 

You could also try and see if the same behavior occurs with the official ST eval board and debug from there.

 

 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

OK, I don't have a VBUS voltage divider on my hardware and start to think it is related to that. 

Hi, ok, I think the problem is solved.

Thanks for that pointer to the ADC. During my debugging session I saw the library constantly executing the function you pointed to after connecting the USBC port.

After adding the voltage divider and configuring the ADC properly both orientations work without resetting the MCU.

Before I was also not getting cable detach traces. Now I do see them.

I would say that without the ADC it would never realize the cable was detached and kept CC1/CC2 configuration from the first negotiation.

Regards, Jose