2024-02-28 02:46 AM - last edited on 2024-02-28 03:02 AM by Peter BENSCH
Hi, I want to use a USB with USB-C connector and STM32F427 mostly as a HOST for USB mass storage, but it has to be able to switch to device, works as serial port. A 5V can be applied to the USB by a power switch for a HOST mode, and can be detected with a resistor divider and STM's VBUS pin in both modes. What I am wondering is a power delivery. I do not want to use an additional PD controller. Is it possible to use simple pullups/pulldowns resistors on CC pins? Do I have to switch them eg. by a transistors, to connect PU in host mode and PD in device mode? Maybe someone did it already and can suggest simple solution.
Marcin
2024-03-04 05:31 AM
Hello @mkuczma
You can use a MOSFET to switch the power delivery. Check the shield for dual role as an example. Schematic diagrams - (st.com)
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.