2020-12-14 08:21 AM
Does the ADC need to be initialized in a special way for the USBPD stack to work properly?
I am trying to implement PD on a STM32G431 and the USBPD stack doesn't seem to work. If a powersource is connected, the CAD state changes to ATTACHED but then it immediately changes to DETACHED and waits for the VBUS voltage to drop to zero, which doesn't happen because the source is still attached and supplies the standard 5V.
The stack is resetting right after the attached state.
Solved! Go to Solution.
2020-12-16 12:36 AM
Nevermind, I found out what's wrong.
CRC needs to be active for USBPD to work (I was either too dumb to find a reference for this or to make the "obvious" connection after looking at PD communications, or it's just not clearly described anywhere). In the example projects CRC is initialized with the Trace utility so you never have any issues there.
So if you're USBPD stack is hard resetting after first successfully receiving messages from a PD device you probably forgot to activate CRC.
2020-12-16 12:36 AM
Nevermind, I found out what's wrong.
CRC needs to be active for USBPD to work (I was either too dumb to find a reference for this or to make the "obvious" connection after looking at PD communications, or it's just not clearly described anywhere). In the example projects CRC is initialized with the Trace utility so you never have any issues there.
So if you're USBPD stack is hard resetting after first successfully receiving messages from a PD device you probably forgot to activate CRC.
2020-12-16 01:00 AM
Dear @FGeig.1,
could you please provide use a cpd file (USB-PD trace)?
Remind: https://wiki.st.com/stm32mcu/wiki/USB_Power_Delivery_overview#Specific_tools
Thanks,
Yohann
2020-12-16 02:34 AM
Hi @Yohann M. ,
Thank you for your response!
Unfortunately I can't use the Trace utility but the problem was that CRC was not activated and neither was the Trace utility. Activating CRC solves the hard reset issue, everything is working as expected now.
2020-12-16 03:43 AM
Our internal PD is very useful for us (but also for you) to debug the PD protocol and internal states of the USB-PD lib.
Just for our information, what is the blocking issue to use the trace utility?
For your information, we suggested another way to connect the trace:
Yohann
2020-12-17 03:14 AM
Sure!
I was asked to implement USBPD on a custom board with an STM32G431 that was developed by someone else.
Almost all pins on the STM are in use and a UART Tx pin was not easy to reach. But I agree that it is a great tool for debugging and if things hadn't worked out, we would have adapted the board in order to use the Trace utility.
Regards