Skip to main content
Visitor II
December 6, 2022
Solved

STM32G431 USB C power delivery and Debug options

  • December 6, 2022
  • 3 replies
  • 3630 views

I'm designing a board G4 MCU and want to be able to power the board from USB C as well as debug or program the board.

  1. Is it possible to program the MCU via the USB C or usb 2.0 interface?
  2. If not, and I have to use SWD, what would i need in order to program the board? Would i need a dedicated MCU like the NUCLEO board or would i use need some kind of USB to JTAG/SWD cable connected to the CLK and IO pins?
  3. If power is being delivered via USB C how might I use this tho power the rest of the board and not just the MCU?

I tried using this post as reference to get a better understanding.

https://community.st.com/s/feed/0D53W000007zVncSAE

    This topic has been closed for replies.
    Best answer by Michael E

    Hello if you need more information on USBPD vs STM32 please check wiki articles.

    There is also various helpful examples:

    3 replies

    Super User
    December 7, 2022

    It's not realistic to debug via a direct USB interface to the board. The workable approach is to use SWD and put a header on the board to interface with a programmer such as the STLINK-V3MINI. No need for a separate chip. Note that the board needs powered elsewhere as the programmer does not provide power.

    You can't power the MCU directly from USB as the voltage is too high. You will need an LDO to take the ~5V USB supply down to something like 3.3V which is usable by the MCU. You can use the 5V supplied by the USB for whatever else is on your board, so long as you stay within the power budget.

    RMasAuthor
    Visitor II
    December 7, 2022

    What is the purpose of USB C power delivery if the MCU is not capable of handling the voltages? it's the interface connected directly to the MCU pins? How would i manage the voltages from USB if they are supplied directly to the MCU?

    Super User
    December 7, 2022

    The purpose is to provide power.

    These are electronics 101 questions. Managing voltages is a fairly common theme. Google linear regulators.

    Graduate
    December 7, 2022

    Why don't you read some documents on USBPD and the solutions provided by ST? There is a choice of X-Nucleo extension boards for PD experiments and a bunch of examples and step-by-step tutorials on this topic - easy to find on ST website. Just read, listen, look at the schematics.

    Michael EAnswer
    Technical Moderator
    December 7, 2022

    Hello if you need more information on USBPD vs STM32 please check wiki articles.

    There is also various helpful examples: