2021-08-13 07:28 AM
Hi All, I designed my board with a STM32G0 series MCU with the main intention of using its USB-PD peripheral. I later realized that it is only the STM32G0x1 series MCUs would be capable of USB-PD while I will be receiving a board turn with an STM32G0x0 series..
Is there a way to setup USB-PD on my STM32G030K8 by including the necessary C and header files used with USB-PD? The pins I would need to configure in the .ioc file would include TCPP01_DB, UCPD1_CC1, and UCPD1_CC2, but I'm an not really sure how to go about that either if the pins do not have that option.
Thanks,
Solved! Go to Solution.
2021-08-13 07:43 AM
Hi @NYou.1
I'm afraid the answer is no, as the UCPD peripheral (handling the USB-PD feature) is no available on STM32G030K8. Application software will have no peripheral to drive ...
Regards
2021-08-13 07:43 AM
Hi @NYou.1
I'm afraid the answer is no, as the UCPD peripheral (handling the USB-PD feature) is no available on STM32G030K8. Application software will have no peripheral to drive ...
Regards
2021-08-13 07:56 AM
Okay, I understand. This seems like a nuance that was not addressed in all the marketing material/presentations for the STM32G0 Series MCUs. But also, I should have read closer on the product page.
Thank you for the response!
2022-07-27 12:23 AM
A year late to the party, but here is almost the answer you wanted to hear: Yes, you can do USB-PD on processors that do not have a UCPD Module, though you can NOT do it on your existing board.
I prototyped USB-PD communication on a STM32L chip, before I was able to find stock for STM32G0B1. It is hardware and software hacking at its finest and not for the faint of heart, but it can be done. You have to write all your own code and need a bunch of external hardware. You will likely not be able to meet all the specs spelled out in USB-PD 2.0 which means you most probably cannot get it certified, but you can get it to work.
To transmit: Compute and append the CRC. Convert binary to 4b5b while adding the preamble and EOP. That gives you BMC bitstream that can be sent out using the SPI port.
To receive: Have an external fast comparator with adequate hysteresis convert the 1.2V signal into digital stream that is fed into a timer input on the processor. Use input capture with DMA to collect the transition times for all the edges. This is your BMC data (lots and lots of RAM). Software can decode that to verify/strip the header and EOP and come up with the 4b5b data. Convert the 4b5 to binary. Check CRC.
Not something any sane person would do if you could buy a processor with UCPD module. But these are not sane times and the unavailability of chips is driving many of us insane :)
Regards,
Hamid
2022-07-28 07:44 AM
Before we got the UCPD (first availability in G0) it is true we did USB-PD with STM32F072 and discrete frontend : P-NUCLEO-USB001. But it was very difficult to certify such a hardware, tune the eye diagram, manage the collision avoidance... In terms of peripheral resources, it didn't let a lot of free ones for the user application.
Now that the UCPD is available, all the low level functions are done by a dedicated hardware block, and it is easier to focus on application instead of the real time protocol issues.