USB Type-C Power Delivery using STM32 MCUs and MPUs
Introduction
This application note is a guideline for using USB Type-C® Power delivery with STM32 MCUs and STM32 MPUs, also referring
to the TCPP01-M12 protection circuit. The document introduces some basics of the two new USB Type-C® and USB Power
Delivery standards.
The USB Type-C® technology offers a single platform connector carrying all the necessary data. This new reversible connector
makes plug insertion more user friendly. Using the Power Delivery protocol, it allows negotiation of up to 100 W power delivery
to supply or charge equipment connected to a USB port. The objective is to save cables and connectors, as well as universal
chargers.
The USB Type-C® connector provides native support of up to 15 W (up to 3 A at 5 V), extendable to 100 W (up to 5 A at 20 V)
with the optional USB Power Delivery feature.
AN5225 - Rev 3 - September 2020
For further information contact your local STMicroelectronics sales office.
www.st.com
1General information
This document applies to STM32 MCUs and MPUs, based on Arm® Cortex®-M processor.
Note:Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
1.1Acronyms and abbreviations
AMSAtomic message sequence
APDOAugmented power delivery object
BMCBi-phase mark coding
BSPBoard support package
CADCable detection module
DFPDownstream facing port
DPMDevice policy manager
DRPDual-role power
DRSData role swap
GPGeneral purpose
GUIGraphical user interface
HALHardware abstraction layer
HWHardware
LLLow layer
MSCMessage sequence chart
OVPOver-voltage protection
PDOPower delivery object
PEPolicy engine
PRLPhysical protocol layer
PRSPower role swap
SNKPower sink
SRCPower source
UCPDUSB Type-C power delivery
UFPUpstream facing port
VDMVendor defined messages
FWUPFirmware update
PPSProgrammable power supply
TCPMType-C port manager
TCPCType-C port controller
TVSTransient voltage suppression
AN5225
General information
AN5225 - Rev 3
page 2/64
1.2Reference documents
STMicroelectronics ecosystem documents
[1]Managing USB power delivery systems with STM32 microcontrollers, UM2552
[2]STM32CubeMonitor-UCPD software tool for USB Type-C Power Delivery port management, UM2468
[3]TCPP01-M12 USB Type-C port protection, DS12900
[4]USB Type-C protection and filtering, AN4871
[5]STM32CubeMonitor-UCPD software tool for USB Type-C Power Delivery port management, DB3747
[6]USB Type-C and Power Delivery DisplayPort Alternate Mode, TA0356
[7]Overview of USB Type-C and Power Delivery technologies, TA0357
[8]STM32MP151/153/157 MPU lines and STPMIC1B integration on a battery powered application, AN5260
USB specification documents
AN5225
Reference documents
[9]USB2.0 Universal Serial Bus Revision 2.0 Specification
[10]USB3.1 Universal Serial Bus Revision 3.2 Specification
[11]USB BC Battery Charging Specification Revision 1.2
[12]USB BB USB Device Class Definition for Billboard Devices
[13]Universal Serial Bus Power Delivery Specification, Revision 2.0, Version 1.3, January 12, 2017
[14]Universal Serial Bus Power Delivery Specification, Revision 3.0, Version 2.0, August 29 2019
[15]Universal Serial Bus Type-C Cable and Connector Specification 2.0, August 2019
[16]USB Billboard Device Class Specification, Revision 1.0, August 11, 2014, http://www.usb.org/developers/docs
AN5225 - Rev 3
page 3/64
2USB Type-C in a nutshell
The USB Implementers Forum (USB-IF) introduces two complementary specifications:
•The USB Type-C® cable and connector specification release 1.3 details a reversible, slim connector system
based on high-speed USB2.0 signals and two super-speed lanes at up to 10 Gbit/s, which can also be used
to support alternate modes.
•The USB Power Delivery (PD) specification revisions 2.0 and 3.0 detail how a link can be transformed from
a 4.5 W power source (900 mA at 5 V on VBUS), to a 100 W power or consumer source (up to 5 A at 20 V).
The new 24-pin USB Type-C® plug is designed to be non-polarized and fully reversible, no matter which way it is
inserted.
It supports all the advanced features proposed by Power Delivery:
•negotiating power roles
•negotiating power sourcing and consumption levels
•performing active cable identification
•exchanging vendor-specific sideband messaging
•performing alternate mode negotiation, allowing third-party communication protocols to be routed onto the
reconfigurable pins of the USB Type-C® cable
AN5225
USB Type-C in a nutshell
Figure 1. USB connectors
Mini ABMicro AB
2.02.0
Multiple connectors to support
all kind of USB data
3.0
Unique
reversible
connector for all
specifications
AN5225 - Rev 3
The following points should also be noted:
•USB Type-C® cables use the same plug on both ends.
•USB Type-C® supports all prior protocols from USB2.0 onward, including the driver stack and power
capability.
•The new connector is quite small (it is 8.4 mm wide and 2.6 mm high).
page 4/64
AN5225
USB Type-C® vocabulary
As shown in Figure 1. USB connectors, the new USB Type-C® plug covers all features provided by previous
plugs, which ensure flexibility and siplifies application.
A USB Type-C® port can act as host only, device only, or have dual function. Both data and power roles can
independently and dynamically be swapped using USB Power Delivery commands.
2.1
USB Type-C® vocabulary
The terminology commonly used for USB Type-C® system is:
•Source: A port power role. Port exposing Rp (pull-up resistor, see Figure 3. Pull up/down CC detection) on
CC pins (command control pins, see Section 4 CC pins), and providing power over VBUS (5 V to 20 V and
up to 5 A), most commonly a Host or Hub downstream-facing port (such as legacy Type-A port).
•Sink: A port power role. Port exposing Rd (Pull down resistor. See Figure 3. Pull up/down CC detection) on
CC pins and consuming power from VBUS (5 V to 20 V and up to 5 A), most commonly a device (such as a
legacy Type-B port)
•Dual-role power (DRP) port: A port that can play source or sink power roles, reversible dynamically.
•Downstream-facing port (DFP): A port data role. A USB port at higher level of USB tree, such as a USB
host or a hub expansion.
•Upstream-facing port (UFP): A port data role. A USB port at lower level of USB tree, such as a USB device
or a hub master port.
2.2Minimum mandatory feature set
It is not mandatory to implement and support all of the advanced features that are defined within Type-C and
Power Delivery specifications.
The mandatory functions to support are:
•cable attach and detach detection
•plug orientation/cable twist detection
•USB2.0 connection
AN5225 - Rev 3
page 5/64
3Connector pin mapping
The 24-pin USB Type-C® connector includes:
•symmetric connections:
–USB2.0 differential pairs (D+/D-)
–power pins: VBUS/GND
•asymmetric connections
–two sets of TX/RX signal paths which support USB3.1 data speed
–configuration channels (CC lines) which handle discovery, configuration and management of USB
Type-C® power delivery features
–two side-band use signals (SBU lines) for analog audio modes or alternate mode
AN5225
Connector pin mapping
Figure 2. Receptacle pinout
A12A11A10A9A8A7A6A5A4A3A2A1
GNDRX2+ RX2-
GNDTX2+ TX2-
B1B2B3B4B5B6B7B8B9B10B11B12
Pin
A1GNDGround returnup to 5 A split into 4 pins
A2TX1+
A3TX1-
A4VBUSBus power100 W max power split into 4 pins
A5CC1 or VCONN
A6D+
A7D-
A8SBU1Side band useAlternate mode only
A9VBUSBus power100 W max power split into 4 pins
A10RX2-
A11RX2+
A12GNDGround returnup to 5 A split into 4 pins
B1GNDGround returnup to 5 A split into 4 pins
B2TX2+
B3TX2-
NameDescriptionComment
VBUS
VBUS
Table 1. USB Type-C receptacle pin descriptions
SBU1D-D+
CC2
Configuration channel or power for
active or electronically marked cable
D+D-
USB3.0 datalines or alternate10 Gbit/s TX differential pair in USB3.1
USB2.0 data lines-
USB3.0 datalines or alternate10 Gbit/s RX differential pair USB3.1
USB3.0 datalines or alternate10 Gbit/s TX differential pair in USB3.1
CC1
SBU2
VBUS
VBUS
TX1-TX1+ GND
RX1-RX1+GND
In VCONN configuration, min power is
1 W
AN5225 - Rev 3
page 6/64
PinNameDescriptionComment
B4VBUSBus power100 W max power split into 4 pins
B5CC2 or VCONN
B6D+
B7D--
B8SBU2Side band useAlternate mode only
B9VBUSBus power100 W ma power split into 4 pins
B10RX1-
B11RX1+
B12GNDGround returnUp to 5 A split into 4 pins
3.1VBUS power options
VBUS provides a path to deliver power between a host and a device, and between a charger and a host or
device.
Power options available from the perspective of a device with a USB Type-C® connector are listed below.
AN5225
VBUS power options
Configuration channel or power for
active or electronically marked cable
USB2.0 datalines
USB3.0 datalines or alternate10 Gbit/s RX differential pair in USB3.1
In VCONN configuration, min power is
1 W
-
Note:
Table 2. Power supply options
Mode of operationNominal voltageMaximum currentNote
USB2.05 V500 mA
USB3.15 V900 mA
USB BC1.25 V1.5 ALegacy charging
Current @1.5 A5 V1.5 A
Current @3 A5 V3 A
USB PD5 V to 20 V5 ADirectional control and power level management
Default current based on specification
Support high-power devices
USB Type-C® to Type-C™ cable assembly needs VBUS to be protected against 20 V DC at the rated cable
current (3 A or 5 A).
AN5225 - Rev 3
page 7/64
4CC pins
There are two CC pins (CC1 and CC2) in the Type-C connector, but only one CC pin is present on the cable plug
at each end of the cable (they are connected in common through the cable). On both CC1 and CC2, a source
must expose Rp pull up resistors, whereas a sink must expose Rd pull down resistors. Electronic cables need to
provide a resistor, Ra, to ground on V
From a source point of view, the state of attached devices can be determined by referring to Table 3.
AN5225
CC pins
.
CONN
Table 3. Attached device states - source perspective
CC1CC2State
OpenOpenNothing attached
RdOpen
OpenRd
OpenRa
RaOpen
RdRaPowered cable with sink, VCONN-
RaRd
RdRdDebug accessory mode attached
RaRaAudio adapter accessory mode attached
Sink attached
Powered cable without sink attached
powered accessory (VPA), or VCONNpowered USB device (VPD) attached.
4.1Plug orientation/cable twist detection
As a USB Type-C® cable plug can be inserted in the receptacle in either orientation, it is mandatory to first detect
the orientation. The detection is done through the CC lines using the Rp/Rd resistors.
Initially a DFP presents Rp terminations on its CC pins and a UFP presents Rd terminations on its CC pins.
To detect the connection, the DFP monitors both CC pins (see figure 4-30 in [15]).
AN5225 - Rev 3
page 8/64
Figure 3. Pull up/down CC detection
AN5225
Plug orientation/cable twist detection
+
DFP monitors for connection
DFP monitors for connection
Rp
Rp
CC1
CC2
Ra
Cable
CC
UFP monitors for orientation
CC1
Ra
CC2
Rd
Rd
UFP monitors for orientation
AN5225 - Rev 3
page 9/64
4.2Power capability detection and usage
Type-C offers increased current capabilities of 1.5 A and 3 A in addition to the default USB standard.
The current supply capability of the port to the device depends on the Rp pull up resistor value on the DFP.
High current (5 A) capability is negotiated using the USB Power Delivery protocol.
Table 4 shows the possible values, as per [15].
Table 4. DFP CC termination (Rp) requirements
AN5225
Power capability detection and usage
V
BUS
power
Current source to
1.7 V - 5.5 V
Default USB power80 mA ± 20%
Rp pull up to
4.75 V - 5.5 V
56 kΩ ± 20%
Rp pull up to
3.3 V +/-5%
(1)
36 kΩ ± 20%
1.5 A @5 V180 mA ± 8%22 kΩ ± 5%12 kΩ ± 5%
3.0 A @5 V330 mA ± 8%10 kΩ ± 5%4.7 kΩ ± 5%
1. For Rp when implemented in the USB Type-C plug on a USB Type-C to USB 3.1 Standard-A Cable Assembly, a USB Type-
C to USB 2.0 Standard-A Cable Assembly, a USB Type-C to USB 2.0 Micro-B Receptacle Adapter Assembly or a USB
Type-C captive cable connected to a USB host, a value of 56 kΩ ± 5% shall be used, in order to provide tolerance to IR drop
on V
and GND in the cable assembly.
BUS
The UFP must expose Rd-pull down resistors on both CC1 and CC2 to bias the detection system and to be
identified as the power sink, as per [15].
Table 5. UFP CC termination (Rd) requirements
Rd implementationNominal value
± 20% voltage clamp1.1 VNo1.32 V
± 20% resistor to GND5.1 kΩNo2.18 V
± 10% resistor to GND5.1 kΩYes2.04 V
Can detect power
capability?
max voltage on CC pin
The UFP, in order to determine the DFP power capability, monitors the CC line voltages accurately, as per [15].
Table 6. Voltage on sink CC pins (multiple source current advertisements)
Detection
vRa-0.250.150.2
vRd-Connect0.252.04-
vRd-USB0.250.610.66
vRd-1.50.701.161.23
vRd-3.01.312.04-
Min voltage (V)Max voltage (V)Threshold (V)
AN5225 - Rev 3
page 10/64
5Power profiles
The USB Power Delivery protocol enables advanced voltage and current negotiation, to deliver up to 100 W of
power, as defined in [14] and reported in the following figure:
AN5225
Power profiles
Figure 4. Power profile
Table 7 shows the permitted voltage source and programmable power supply (PPS) selections, as a function of
the cable current rating.
Table 7. Fixed and programmable power supply current and cabling requirements
Fixed voltage sourceProgrammable power supply (PPS)
Further information is available in [14] and [15].
AN5225 - Rev 3
page 11/64
6USB power delivery 2.0
In USB power delivery, pairs of directly attached ports negotiate voltage, current and/or the direction of power,
and data flow over the USB cable. The CC wire is used as a BMC-coded communication channel.
The mechanisms used operate independently of other USB power negotiation methods.
6.1Power delivery signaling
All communications are done through a CC line in half-duplex mode at 300 Kbit/s.
Communication uses BMC encoded 32-bit 4b/5b words over CC lines.
6.1.1Packet structure
The packet format is:
•Preamble: 64-bit sequence of alternating 0s and 1s to synchronize with the transmitter.
•SOP*: start of packet. Can be SOP, SOP’ (start of packet sequence prime) or SOP” (start of packet
sequence double prime), see Figure 5. SOP* signaling.
–SOP packets are limited to PD capable DFP and UFP only
–SOP’ packets are used for communication with a cable plug attached to the DFP
–SOP” packets are used for communication with a cable plug attached to the UFP.
A cable plug capable of SOP’ or SOP” communication must only detect and communicate with packets
starting with SOP’ or SOP”.
•Message data including message header which identifies type of packet and amount of data
•CRC: error checking
•EOP: end of packet, unique identifier.
AN5225
USB power delivery 2.0
6.1.2K-codes
K-codes are special symbols provided by the 4b/5b coding. They signal hard reset, cable reset, and delineate
packet boundaries.
DFP
SOP’
Figure 5. SOP* signaling
Cable
Plug
Electronically Marked
Cable
(SOP’)
SOP’’
SOP
Cable
Plug
(SOP ‘’)
UFP
AN5225 - Rev 3
page 12/64
6.2Negotiating power
The DFP is initially considered as a bus master.
The protocol layer allows the power configuration to be dynamically modified.
The power role, data role and VCONN swap are possible independently if both ports support dual power role
functionality.
The default voltage on VBUS is always 5 V and can be reconfigured as up to 20 V.
The default current capability is initially defined by the Rp value, and can be reconfigured as up to 5 A for an
electronically marked USB PD Type-C cable.
The protocol uses start-of-packet (SOP) communications, each of which begins with an encoded symbol (Kcode).
SOP communication contains a control or data message.
The control message has a 16-bit fixed size manages data flow.
The data message size varies depending on its contents. It provides information on data objects.
AN5225
Negotiating power
AN5225 - Rev 3
page 13/64
7USB power delivery 3.0
From the power point of view, there are no differences between USB PD 2.0 and USB PD 3.0. All USB PD 3.0
devices are able to negotiate power contracts with USB PD 2.0 devices, and vice-versa. USB PD 3.0 adds the
following key features:
•Fast role swap
•Authentication
•Firmware update
•Programmable power supply (PPS) to support sink directed charging
The following is a summary of the major changes between the USB PD 3.0 and USB PD 2.0 specifications:
•Support for both Revision 2.0 and Revision 3.0 operation is mandated to ensure backward compatibility with
existing products.
•Profiles are deprecated and replaced with PD power rules.
•BFSK support deprecated including legacy cables, legacy connectors, legacy dead battery operation and
related test modes.
•Extended messages with a data payload of up to 260 bytes are defined.
•Only the VCONN source is allowed to communicate with the cable plugs.
•Source coordinated collision avoidance scheme to enable either the source or sink to initiate an atomic
message sequence (AMS).
•Fast role swap defined to enable externally powered docks and hubs to rapidly switch to bus power when
their external power supply is removed.
•Additional status and discovery of:
–Power supply extended capabilities and status
–Battery capabilities and status
–Manufacturer defined information
•Changes to fields in the passive cable, active cable and AMA VDOs indicated by a change in the structured
VDM version to 2.0.
•Support for USB security-related requests and responses.
•Support for USB PD firmware update requests and responses.
System policy now references USBTypeCBridge 1.0.
AN5225
USB power delivery 3.0
AN5225 - Rev 3
page 14/64
8Alternate modes
All the hosts and devices (except chargers) using a USB Type-C® receptacle shall expose a USB interface.
If the host or device optionally supports alternate modes:
•The host and device shall use USB power delivery structured vendor defined messages (structured VDMs)
to discover, configure and enter/exit modes to enable alternate modes.
•It is strongly encouraged that the device provide equivalent USB functionality where such exists for the best
user experience.
•Where no equivalent USB functionality is implemented, the device must provide a USB interface exposing a
USB billboard device class to provide information needed to identify the device. A device is not required to
provide a USB interface exposing a USB billboard device class for non-user facing modes (for exmple
diagnostic modes).
As alternate modes do not traverse the USB hub topology, they must only be used between a directly connected
host and device.
8.1Alternate pin re-assignments
In Figure 6, pins highlighted in yellow are the only pins that may be reconfigured in a full-feature cable
AN5225
Alternate modes
Figure 6. Pins available for reconfiguration over the Full Featured Cable
A12A11A10A9A8A7A6A5A4A3A2A1
GNDRX2+ RX2-
GNDTX2+ TX2-
B1B2B3B4B5B6B7B8B9B10B11B12
VBUS
VBUS
SBU1D-D+
VCONN
SBU2
CC
VBUS
VBUS
TX1-TX1+ GND
RX1-RX1+GND
Reconfigurable pin
Figure 7 shows pins available for reconfiguration for direct connect applications. There are three more pins than in
Figure 6 because this configuration is not limited by the cable wiring.
AN5225 - Rev 3
page 15/64
Figure 7. Pins available for reconfiguration for direct connect applications
A12A11A10A9A8A7A6A5A4A3A2A1
GNDRX2+ RX2-
VBUS
SBU1D-D+
CC
VBUS
TX1-TX1+ GND
AN5225
Billboard
GNDTX2+ TX2-
B1B2B3B4B5B6B7B8B9B10B11B12
8.2Billboard
The USB Billboard Device Class definition describes the methods used to communicate the alternate modes
supported by a device container to a host system.
This includes string descriptors to provide support details in a human-readable format.
For more details, refer to [16].
VBUS
VCONN
SBU2
VBUS
RX1-RX1+GND
Reconfigurable pin
AN5225 - Rev 3
page 16/64
9Product offer
STM32 MCUs and STM32 MPUs handle USB Type-C / USB Power Delivery interfacing by using the STM32
integrated UCPD (USB Type-C Power Delivery) peripheral, or a set of general-purpose (GP) peripherals. See
USB Type-C and Power Delivery application page.
Secure element
AN5225
Product offer
Figure 8. USB Type-C Power Delivery block diagram
One chip
Dp/Dn
USB Power
Delivery
controller
Power
management
USB Type-C
interface (PHY)
VBus
TM
Load switch
Protection
CC lines
Figure 9. STM32G0 Discovery kit USB Type-C analyser
USB
TM
Type-C
receptacle
AN5225 - Rev 3
page 17/64
AN5225
Product offer
STM32 MPU product specificities
For the STM32 MPU products, take into the consideration the following:
•USB is only supported on Cortex-A7 core. No support on Cortex-M4 core.
•For compatibility with Linux framework, USB Type-C is managed by external devices. Refer to MB1272DK2-C01 board schematics on , CN7 implementation with STUSB1600 chipset (as opposed to CN6
implementation with ADC).
For more information, refer to section USB port using USB Type-C® receptacle in [8].
AN5225 - Rev 3
page 18/64
Type-C with no power delivery
10Type-C with no power delivery
This chapter may not fully apply to STM32 MPU products. Refer to Section 9 Product offer for their specificities.
10.1STM32 USB2.0-only device conversion for USB Type-C platforms
A USB2.0 legacy device needs to present itself as a UFP by means of an Rd pull-down resistor between the CC
line and ground. It is assumed here that the maximum legacy USB 2.0 device current is needed, and it is
therefore not necessary to monitor the CC lines.
Since the plug is reversible, the two DP/DN pairs need to be connected to each other as close as possible to the
receptacle, before being routed to the STM32 device.
Figure 10. Legacy device using USB Type-C receptacle
Connector
Receptacle
AN5225
10.2
CC1
CC2
Rd2
5.1k +/-20%
DP1
DP2
DN1
DN2
GND
Rd1
5.1k +/-20%
STM32 USB2.0 host conversion for USB Type-C platforms
STM32x
USB_DP
USB_DN
AN5225 - Rev 3
This use case describes how to exchange a USB2.0 standard A receptacle for a USB Type-C® receptacle.
As the platform is designed for USB2.0, the maximum current capacity is 500 mA. If a higher supply current is
available in the application, the Rp resistors can be adjusted to give 1.5 A or 3 A capability.
A USB2.0 legacy host needs to be configured as a DFP by means of a Rp pull up resistor between the CC line
and the 5 V supply.
As the plug is reversible, the two DP/DN couples need to be connected in pairs as close as possible to the
receptacle, before being routed to the STM32 device.
Monitoring CC lines through the ADC_IN inputs allow device-attachment detection and enabling of VBUS on the
connector.
page 19/64
Connector
receptacle
V
BUS
STM32 legacy USB2.0 OTG conversion for USB Type-C platforms
Figure 11. Legacy host using USB Type-C receptacle
5V supply
STMPS2151
2
IN
1
OUT
V
BUS
Rp1
56k +/-5%
EN
GND
4
5
V
Rp2
56k +/-5%
BUS
_enable
AN5225
STM32x
GPIO
CC1
CC2
DP1
DP2
DN1
DN2
GND
ADC_IN1
ADC_IN2
USB_DP
USB_DN
10.3STM32 legacy USB2.0 OTG conversion for USB Type-C platforms
This use case explains how to exchange USB2.0 micro-AB receptacle for a USB Type-C® receptacle.
In this use case the platform is designed for USB2.0, so the maximum current capacity is 500 mA. If a higher
supply current is available in the application, the Rp resistors can be adjusted to give 1.5 A or 3 A capability.
A legacy OTG platform starts to work as host or device depending on the USB_ID pin impedance to ground
provided by the cable.
USB Type-C® is fully reversible, so the cable does not provide any role information. The role needs to be detected
by sensing the CC lines (for example by using the ADC through its ADC_IN1 and ADC_IN2 inputs to detect the
CC line level).
AN5225 - Rev 3
page 20/64
Loading...
+ 44 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.