cancel
Showing results for 
Search instead for 
Did you mean: 

How to set USB_PD PDO

Sodag.1
Associate II

We are planning to use STM32G071 in our next project.

We would like to have 9V@3A in PDO1.

So we edited the PDO1 data in the usbpd_pdo_defs.h file as follows.

​[0x0202D12C]

00 0 0 0 0 1 00 000 0010110100 0100101100​

Bit Description Applied value

[31,30]​ Fixed supply 00b

[29] Dual-role power 0b

[28] Higher capability 0b

[27] Unconstrained power 0b

[26] USB communication capable 0b

[25] Dual-role data 1b

[24,23] Value 00b

[22-20] Reserved 000b

[19-10] Voltage 0010110100b

[9-0] Current 0100101100b

However, only 5v output has been confirmed.

Where should we fixed?

11 REPLIES 11
HFISTM
ST Employee

I just compiled and tested your application, it works fine and I am able to select the 15V PDO.

I even flashed the binary you compiled on your PC (as you sent it with the project in your previous message). It works fine and selects the 15V PDO.

As you can see in my trace, the sink asks for position 4 which correspond to 15V.

0693W00000GXi0AQAT.pngI suggest you to retry by first erasing your STM32 completely (using STM32CubeProgrammer), then re-flash.

Regards

Sodag.1
Associate II

Thank you for your answer.

After erasing the STM and rewriting the code, I was able to extract the specified voltage.

Thank you for your cooperation.