2024-08-15 12:40 PM
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.
Solved! Go to Solution.
2024-08-18 09:23 PM
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
2024-08-15 04:42 PM
Can you show the schematic?
2024-08-15 06:26 PM
We are transitioning from FUSB302 PD controller. Right now we have the same DNP config as schematic for jumper selection of STM32 UCPD controller.
2024-08-16 04:49 AM - edited 2024-08-16 06:11 AM
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?
2024-08-16 06:46 AM
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.
2024-08-18 02:03 PM
You can try and follow
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.
2024-08-18 02:54 PM
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?
2024-08-18 03:41 PM
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.
2024-08-18 04:27 PM
OK, I don't have a VBUS voltage divider on my hardware and start to think it is related to that.
2024-08-18 09:23 PM
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