cancel
Showing results for 
Search instead for 
Did you mean: 

Initialization of ADC for USBPD?

FGeig.1
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
FGeig.1
Associate III

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.

View solution in original post

5 REPLIES 5
FGeig.1
Associate III

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.

Yohann M.
ST Employee

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

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.

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:

https://wiki.st.com/stm32mcu/wiki/USB_Power_Delivery_overview#How_to_connect_the_trace_TRACER_EMB_with_no_ST-LINK_on_my_board-3F

Yohann

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