Custom USB PD Implementation on STM32G0
Hi everyone,
I have been searching for about 3 days straight for a reasonable solution to a USB PD project, and I am still feeling lost. Maybe someone can point me in the right direction.
We need to design a USB PD sink circuit which authenticates the power source before applying VBUS to any internal circuits. We need to reject non-genuine sources due to operator safety reasons. We have close control over the source's firmware (since we are the source manufacturer). We are working with a large customer to develop this authentication solution for their system.
We have two possible solutions:
1.) Simple: Send "Discovery Identity" request to source. If VendorID reply is correct, request higher power USB PD profile, and apply VBUS.
2.) More complicated(?): Use USB PD3.0 authentication messages via extended messages. I'm very lose on this one, regarding how we could implement this. (If it seems reasonable, please let me know.)
I spent many hours looking through the code for the X-CUBE USB PD software: https://github.com/st-one/X-CUBE-USB-PD
It appears to have just about all USB PD functions implemented, so I could conceive how we could implement our solution. This code seems to be targeted at STM32F0 and STUSB1602, so it would require two ICs.
Then, I noticed that STM32G0 supports USB PD natively. Does that mean we don't need an external IC like STUSB1602?
If so, what would be the easiest way to develop a custom USB PD solution for the STM32G0? Is there firmware/libraries available? Example projects we can modify? We need to be able to implement non-standard logic like checking for ProductID and preventing further negotiation if authentication failed. That is, we need more than just set a few custom USB PD profiles.
Any and all suggestions are greatly appreciated.
Thank you for your time.
Tim
