Skip to main content
Visitor II
August 6, 2025
Solved

Is there up-to-date documentation for using the USB PD middleware?

  • August 6, 2025
  • 5 replies
  • 489 views

I've built a board around the STM32G0B1, hoping to get it to negotiate as much USB PD power as I can get. I've followed this tutorial: https://www.youtube.com/watch?app=desktop&v=-vsJhNIaHxE but see that some of the callback functions are deprecated: 

zbrozek_0-1754455683960.png

But this header doesn't say what the new function is or where to find out what the new interface is.

This document is a lot of pages that don't tell me anything useful about how to actually use the library: https://www.st.com/resource/en/user_manual/um2552-managing-usb-power-delivery-systems-with-stm32-microcontrollers-stmicroelectronics.pdf

This one doesn't specify what are the functions to implement for the modern callbacks: https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink

Could someone point me to an up-to-date reference on what the requirements are to use this plugin?

    This topic has been closed for replies.
    Best answer by FBL

    Hi @zbrozek 

    First, let me thank you for your feedback.

    Second, I think UM2902 section 2.3 BSP for USB Power Delivery, can be helpful. You can always follow x cube tcpp current callback function names and prototypes, even if you are not using a TCPP chip. This will give you practical insights.

    5 replies

    Technical Moderator
    August 6, 2025

    Hi @zbrozek 

    BSP_PWR_VBUSGetVoltage function is not obsolete but has undergone updates in recent STM32 firmware packages. It is still used for VBUS measurement and can be customized to fit specific hardware and VBUS sensing methods. However, its naming and implementation have been updated in newer firmware versions, such as X-CUBE-TCPP, where it has been replaced by BSP_USBPD_PWR_VBUSGetVoltage. Use wikis and examples in X-CUBE-TCPP for up to date guidance.

    zbrozekAuthor
    Visitor II
    August 6, 2025

    Is there documentation that explains when to use the TCPP middleware versus the USBPD middleware? I'm not using a TCPPxx chip at all, so it was not an obvious package to examine.

     

    Further, is there a document that clearly describes the requirements for implementing the TCPP middleware? The wiki article I linked targets that middleware, but only covers clicking through the GUI and says nothing of the requirements (e.g., does not explicitly show function prototypes for callbacks that must be implemented).

     

    It would also be lovely if in a future release of the firmware package that the weak function definitions be removed so that compilation would fail if required callback functions are not implemented.

    FBLAnswer
    Technical Moderator
    August 6, 2025

    Hi @zbrozek 

    First, let me thank you for your feedback.

    Second, I think UM2902 section 2.3 BSP for USB Power Delivery, can be helpful. You can always follow x cube tcpp current callback function names and prototypes, even if you are not using a TCPP chip. This will give you practical insights.

    zbrozekAuthor
    Visitor II
    August 6, 2025

    Thanks; that video is helpful. And I have made additional progress using the TCPP middleware, though it does demand control of a couple of unconnected GPIOs to control a phantom TCPP01 chip. I'm still not getting the behavior that I want, but I have more threads to pull and will come back for more advice when I exhaust obvious avenues of exploration.

    It would be great if the TCPP middleware were specifically for the TCPPxx series of chips, and the USBPD middleware were better encapsulated and more clearly documented.

    zbrozekAuthor
    Visitor II
    August 6, 2025

    Also, what does it take to use the STM32CubeMonitor-UCPD? I have wired out LPUART1 to the debug header on my ST-Link/V3PWR but the software does not seem to recognize the ST-Link at all. Is there some trick to get that to work?

    Technical Moderator
    August 15, 2025

    Hi @zbrozek 

    If your initial question is already answered, accept as solution and open new thread for further questions to ensure clarity and adhere to community guidelines.