cancel
Showing results for 
Search instead for 
Did you mean: 

I am using the USB-PD protocol with the stm32G071RBT6 processor with the tcpp01 card. I can only get 5v at the output(Vbus). I can't get 20v(Vbus). what should I do. APPLICATION NOTE(AN5418) , TCPP01-M12 DOCUMENT AND LINK OF USB-PD CODE BELOW.

Mtopa.1
Associate II

BOARDS: STM32G071RBT6,x-nucleo-usbpdm1

APPLICATION VIDEO:https://www.youtube.com/watch?v=-vsJhNIaHxE

https://github.com/mbekirtopal/USB-PD/tree/main/usb_delivery

1 ACCEPTED SOLUTION

Accepted Solutions
Yohann M.
ST Employee

Dear @Mtopa.1​ 

You could refer to AN5418 and mainly the §5.1.4.

Idea is to change the Sink PD0 to accept 20V. For instance, if you want to have a Sink PDO 20V/3A, you should put the value '0x0006412C'.

In our GO demonstration, we provided user macro to help writing PDO:

STM32G081B-EVAL/Demonstrations/DemoUCPD/Inc/usbpd_pdo_defs.h

Yohann

View solution in original post

10 REPLIES 10
Nicolas P.
ST Employee

Hello @Mtopa.1​ 

The AN5418 target is to get your first contract.

If you want to act as sink, and cannot get other PDO than 5V, please check this wiki

You can also find full sink application with TCPP01 here.

Mtopa.1
Associate II

Thank you Nicolas,

I don't know how to change output value in sink application. Output is fixed with 5v as default how can I change it.

Yohann M.
ST Employee

Dear @Mtopa.1​ 

You could refer to AN5418 and mainly the §5.1.4.

Idea is to change the Sink PD0 to accept 20V. For instance, if you want to have a Sink PDO 20V/3A, you should put the value '0x0006412C'.

In our GO demonstration, we provided user macro to help writing PDO:

STM32G081B-EVAL/Demonstrations/DemoUCPD/Inc/usbpd_pdo_defs.h

Yohann

Nicolas P.
ST Employee

In addition to what @Yohann M.​ wrote, you can have a look here, to see how the PDO selection strategy is done.

@Mtopa.1​ : have you activated the TRACER_EMB ? Check chapter 5.2.2 in AN5418. You will have help in the debug trace (with UCPD monitor) to see what is going on...

Thank you Yohann,

When I set sink pdo from cubemx, the section with sink pdo in cubeide comes as a comment line. How can I remove it?

What do you mean by comment?

'U' at the end of the PDO is a C keyword to indicate the value is an unsigned int.

Note: you agree that 0x204B0FA is not a valid Sink PDO!

A block of code enclosed in #if and #endif is closed.( usbpd_pdo_defs.h)

'__USBPD_PWR_IF_C' is not comment but it allows to define a variable in h file which is declared only by the file 'usbpd_pwr_if.c'. Other files use the variables as extern ones.

I tried to change the output value in the USBPD_StatusTypeDef USBPD_PWR_IF_Init(void) function in __USBPD_PWR_IF_C, but I still got 5v. How can I solve this?