UCPD peripheral in Arduino

Working libraries, libraries being ported and related hardware
Post Reply
vipqualitypost
Posts: 1
Joined: Mon Jan 29, 2024 5:59 pm

UCPD peripheral in Arduino

Post by vipqualitypost »

Hi,
I have been working on building a USB PD application, and have since been looking into the UCPD peripheral of some STM32 chips (mainly G0 and G4 family). I have no issue getting the stack working with the generated code out of CubeMX (building barebones C with a makefile).
However, I can't seem to get it working when taking the stack and using as a library with Arduino framework. I have brought over the build flags and tried to align the compiling as close as I can to the (working) makefile.
I was able to make the FDCAN peripheral work fine in Arduino by taking some of the generated code from CubeMX as long as HAL calls were wrapped with "C", but this isn't working for me with UCPD. Maybe there is something more complex to the problem that I am missing.

The code does run, and I can make an LED blink, but there is no response on the CC lines when connected to a PD source (goodCRC missing).
I checked out the usb-pd-arduino library, which does not use the ST UCPD stack, but this is not working for me either, although my hardware is slightly different from what is used in that project (I am using the Nucleo G474RE). I am planning to use the device as a PD sink.

Has anyone had success using the UCPD peripheral with the Arduino framework using the stack/library provided by ST?
Post Reply

Return to “Libraries & Hardware”