cancel
Showing results for 
Search instead for 
Did you mean: 

Using USB-PD and USB-CDC together

Tarru
Associate II

Hello,

I'm working on STM32G0B1KET6N uc with custom board.

When I'm using this tutorial: https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink everything is working great, my device is acting as USB PD Sink.

But... when I add USB-CDC support (through CubeMX in STM32CubeIDE) and connect board to my Macbook Air - the STM32 ComPort appear only for few seconds and then disappear.

Also, when I'm only using USB-CDC without USB-PD - everything acting as it should - USB-CDC works great.

So - is it possible to use USB-CDC and USB-PD together in parallel? I mean - when I'm using device with PD power supply - USB-PD should be working, and with my computer - USB-CDC should be working.

Thanks,

Kuba

2 REPLIES 2
HFISTM
ST Employee

Hello @Jakub Pepliński​ ,

It is indeed possible to use USB and USBPD in parallel.

There is an application example for G0 using USBPD and USB MSC if you want to see how both can cohabitate. USB CDC should be similar.

https://github.com/STMicroelectronics/STM32CubeG0/tree/master/Projects/STM32G0C1E-EV/Applications/USB-PD/USBPD_SINK_MSC

You can also look at a USBPD + USB CDC example for STM32U5 here:

https://github.com/STMicroelectronics/STM32CubeU5/tree/main/Projects/B-U585I-IOT02A/Applications/USBPD/USBPD_SNK_UX_Device_HID_CDC_ACM

In CubeMX, have you enabled USB support in USBPD middleware, and completed function USBPD_DPM_Notification as explained in file usbpd_usb_if.c/h ?

Could you share the ioc file so that I can check on my side ?

Thank you & best regards

HFISTM
ST Employee

Could you also share the UCPD trace when you plug your device to your computer (chapter Configure Tracer for debug in wiki) ? To save the trace, please see this.

Thanks