Introduction to USB Power Delivery with STM32

Revision as of 16:15, 8 January 2020 by Registered User
Under construction.png Coming soon

On this page you will find applications examples, document, tips and tricks,... related to STM32 Motor control.

1. What is USB Power Delivery

USB Type-C™ Power Delivery technology coming with the new reversible USB Type-C™ connector simplifies the consumers' daily life. The technology offers a single platform connector carrying all the necessary lines : USB 2.0, USB 3.x, and power.

The USB Type-C™ connector provides native support of up to 15 W (5 V @ 3 A), extendable to 100 W (up to 20 V @ 5 A) with the optional USB Power Delivery feature.

Using the power delivery protocol allows negotiation of up to 100 W power delivery to supply or charge equipment connected to a USB port, the objective being fewer cables and connectors, as well as universal chargers.

The power delivery part extends the previous power specifications (USB 2.0, BC 1.2...) as we see below :

The type C interface brings one new signal comparing to previous USB cables : the CC line. (Control channel). On this line, at 300 Kbits/s the power delivery protocol will give the possibility to exchange messages between the 2 connected partners.

The Power Delivery feature comes with a protocol that brings real time possibilities :

  • change the power role. To change dynamically who provides VBUS, independently of the USB data role.
  • change the USB data role dynamically. This replaces the OTG from the previous USB specifications
  • carry authentication messages to authenticate the connected partner.
  • select an "Alternate Mode" to use the USB 3.0 super speed lines to carry video information (Display port or HDMI)
  • firmware update
  • exchange battery information

To determine the power delivery role, a pull up/down resistor has to be presented on the CC lines. so if the power role change is reflected by the updated resistor on the CC line. Whenever you have a "legacy cable" (type A to type C for example), to comply with the specification, it has an integrated resistor. As the type A/B doesn't have a CC line in the connector, the power role is determined by the pull up/down resistor in the plug.

Frequent acronyms :

Acronym Definition
AM Alternate Mode : to specify the use of the super speed lines for Video for example
APDO Augmented power data object. It is a PDO in the case of PPS
DFP Downstream Facing Port
DRP Dual Role Power : the ability to change power role dynamically ie : Source or Sink. the device toggles the pull up / down resistor
GUI Graphical User Interface = UCPD monitor
PDO Power Data Object : the definition of a power capability
PPS Programmable Power Supply : option in power delivery specification to be able to specify a voltage with 20mV precision within a range.
SNK Sink = device that will ask for VBUS
SRC Source = device that will provide VBUS
TCPC Type C Port Controller
TCPM Type C port Manager
UCPD USB Type-C Power Delivery IP
UFP Upstream facing port
VDM Vendor Defined Message. Type of message used for Alternate Mode

2. Getting started with STM32 and USB Power Delivery

Depending on the need, using type-C only may be enough. for example if you need only 5A/3A. In that case you do not need a MCU with UCPD inside. See DB5225 for more details.

If you need specific power delivery features, then you need the stack, and you need to manage CC1 and CC2 lines.

Reminder : even if there is only one CC line used for communication, you need to manage both lines, because you can't guess how the cable will be plugged.

USBPD Type-C cable orientation

The Power delivery protocol is provided by ST as a library as below picture :

USBPD stack architecture

The library (pink box) only includes PE (Policy Engine), PRL (PRotocol Layer), and a part of CAD (CAble Detection). This library is common to all STM32 including the UCPD IP. The device part depends on the STM32 family (STM32G0, STM32G4...) The customer application is located in DPM (Device Policy Manager). This is where the strategy (choose the maximum power...) is coded.

3. Video related to STM32 and USB Power Delivery

STM32G0: Create a USB Power Delivery sink application in less than 10 minutes

4. STM32 compliant with USB Power Delivery

If you are looking for STM32 products that support Power Delivery, you can search in CubeMX for the integration of the UCPD IP. G0 is the only family with parts that contains up to 2 UCPD instances.

5. Specific tools

6. STMicroelectronics Resources

7. Examples

You can find a lot of application examples in the G0 firmware package. For example in Projects\STM32G081B-EVAL\Demonstrations\DemoUCPD