An5225 Usb Typec Power Delivery Using stm32 Mcus and Mpus Stmicroelectronics
An5225 Usb Typec Power Delivery Using stm32 Mcus and Mpus Stmicroelectronics
Application note
Introduction
This application note is a guideline for using USB Type-C® Power Delivery with STM32 MCUs and MPUs in conjunction with the
TCPP01-M12 for power sink, TCPP02-M18 for power source, and TCPP03-M20 for dual-role power protection circuits. Some
basic concepts of the two new USB Type-C® and USB Power Delivery standards are also introduced.
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 allows negotiation of up to 100 W power delivery to
supply or charge equipment connected to a USB port. The objective is to reduce the need for cabling and connectors, and to
facilitate the use of 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.
1 General 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.
As shown in Figure 1. USB connectors, the new USB Type-C® plug covers all features provided by previous
plugs, which ensure flexibility and simplifies the 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.
GND TX2+ TX2- VBUS CC2 D+ D- SBU2 VBUS RX1- RX1+ GND
B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12
USB2.0 5V 500 mA
Default current based on specification
USB3.1 5V 900 mA
USB BC1.2 5V 1.5 A Legacy charging
Current @1.5 A 5V 1.5 A
Support high-power devices
Current @3 A 5V 3A
USB PD 5 V to 20 V 5A Directional control and power level management
Note: 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).
4 CC 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 VCONN.
From a source point of view, the state of attached devices can be determined by referring to Table 4.
Cable
Rp CC1 Rd
CC CC1
Ra Ra Rd
Rp CC2 CC2
1.5 A @5 V 180 mA ± 8% 22 kΩ ± 5% 12 kΩ ± 5%
3.0 A @5 V 330 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 VBUS and GND in the cable assembly.
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 [17].
The UFP, in order to determine the DFP power capability, monitors the CC line voltages accurately, as per [17].
5 Power profiles
The USB Power Delivery protocol enables advanced voltage and current negotiation, to deliver up to 100 W of
power, as defined in [16] and reported in the following figure:
Table 8 shows the permitted voltage source and programmable power supply (PPS) selections, as a function of
the cable current rating.
Table 8. Fixed and programmable power supply current and cabling requirements
With 3 A cable
0 W < PDP <= 15 W PDP / 5 - - - PDP / 5 - - -
15 W < PDP <= 27 W 3.0 A PDP / 9 - - 3.0 A PDP / 9 - -
27 W < PDP <= 45 W 3.0 A 3.0 A PDP / 15 - 3.0 A 3.0 A PDP / 15 -
45 W < PDP <= 60 W 3.0 A 3.0 A 3.0 A PDP / 20 3.0 A 3.0 A 3.0 A PDP / 20
With 5 A cable
60 W < PDP <= 100 W 3.0 A 3.0 A 3.0 A PDP / 20 3.0 A 3.0 A 3.0 A PDP / 20
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.
Cable Cable
DFP Plug
Electronically Marked
Cable Plug UFP
(SOP’) (SOP ‘’)
SOP’
SOP’’
SOP
6.1.2 K-codes
K-codes are special symbols provided by the 4b/5b coding. They signal hard reset, cable reset, and delineate
packet boundaries.
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.
8 Alternate 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.
Figure 6. Pins available for reconfiguration over the Full Featured Cable
GND TX2+ TX2- VBUS VCONN SBU2 VBUS RX1- RX1+ GND
B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12
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.
GND TX2+ TX2- VBUS VCONN SBU2 VBUS RX1- RX1+ GND
B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12
Reconfigurable pin
8.2 Billboard
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 [18].
9 Product 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
One chip
Dp/Dn
USB Power
Delivery USB
controller CC lines Type-CTM
USB Type-CTM receptacle
Protection
interface (PHY)
VBus
Power
Load switch
management
This chapter may not fully apply to STM32 MPU products. Refer to Section 9 Product offer for their specificities.
Connector
Receptacle
STM32x
CC1
CC2
Rd2
Rd1
5.1k +/-20%
5.1k +/-20%
DP1
USB_DP
DP2
DN1
USB_DN
DN2
GND
5V supply
STMPS2151
4
2 IN EN
1 GND 5
Connector OUT
receptacle STM32x
Rp1 Rp2
56k +/-5% 56k +/-5%
CC1 ADC_IN1
CC2 ADC_IN2
DP1
USB_DP
DP2
DN1
USB_DN
DN2
GND
10.3 STM32 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).
X1
Power_switch
Switch_enable
IN EN GPIO_2
Rpd3
OUT GND
Connector 1M
VBUS-A4-B9-A9-B4 VBUS
OTG_FS_VBUS
VDD_3V3
C1
4.7uF VDD_3V3
Pmos
Pmos Rpu3
1M
Rp2 Rp1
36k 36k
OTG_FS_DFP_UFP
GPIO_1
CC1-A5 CC1
ADC_IN1
CC2-B5 CC2
ADC_IN2
Rd1
5.1k
Rd2
5.1k
Nmos
Nmos
GND-A1-B12-A12-B1
OTG_FS_ID
DP1-A6
DP2-B6 OTG_FS_DP
DN1-A7
OTG_FS_DM
DN2-B7
This chapter may not fully apply to STM32 MPU products. Refer to Section 9 Product offer for their specificities.
USB-PD application
User application
USBPD device
Type-C bus
Two parts are fully managed by STMicroelectronics (USBPD core stack and USBPD devices), so the user only
needs to focus development effort on two other parts:
• User application part: called the 'Device Policy Manager' inside the USB organization specification. ST
delivers an application template to be completed according the application need.
• Hardware part: the effort is mainly focused on energy management, which depends on the resource
materials chosen by the user to manage Type-C power aspects.
This document provides hardware implementation guidelines for the use of the STM32 resources (ADC, GPIO
and so on), but the developers' reference for power constraints is Chapter 7: 'Power Supply' of the Universal
Serial Bus Power Delivery Specification.
Also refer to [1] for further information.
PD3 / UCPD2_DBCC2
PD1 / UCPD2_DBCC1
PC10 / USART4_TX
PD2 / UCPD2_CC2
PD0 / UCPD2_CC1
PB7 / USART1_RX
PB3 / COMP2_INM
PB6 / USART1_TX
PB4 / COMP2_INP
PC9 / TIM1_CH2
PD6
PD5
PD4
PB9
PB8
PB5
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
USART4_RX / PC11 1 48 PC8 / TIM1_CH1
PC12 2 47 PA15 / USART2_RX
PC13 3 46 PA14-BOOT0 / USART2_TX
PC14-OSC32_IN 4 45 PA13
PC15-OSC32_OUT 5 44 PA12 [PA10]
VBAT 6 43 PA11 [PA9]
VREF+ 7 42 PA10 / UCPD1_DBCC2
VDD/VDDA 8 41 PD9
VSS/VSSA 9 LQFP64 40 PD8 / I2S1_CK
GPIO_Output / PF0-OSC_IN 10 39 PC7
GPIO_Output / PF1-OSC_OUT 11 38 PC6
GPIO_Input / PF2-NRST 12 37 PA9 / UCPD1_DBCC1
GPIO_Input / PC0 13 36 PA8 / UCPD1_CC1
GPIO_Input / PC1 14 35 PB15 / UCPD1_CC2
GPIO_EXTI2 / PC2 15 34 PB14
GPIO_EXTI2 / PC3 16 33 PB13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
COMP1_INM / PC4
COMP1_INP / PC5
I2S1_WS / PB0
PB1
PB2
PB10
PB12
ADC1_IN0 / PA0
ADC1_IN1 / PA1
ADC1_IN2 / PA2
ADC1_IN3 / PA3
I2S1_SD / PA7
DAC1_OUT1 / PA4
DAC1_OUT2 / PA5
PA6
PB11
The following sections show how to implement each power mode from the hardware point of view. All information
concerning the software implementation is available in the reference specification.
When the USB Type-C sink is back to powered, it changes the value of its Rd pull-down resistance to one of
values specified for normal operation.
Upon transiting from Dead battery state to VBUS-powered state, the Type-C specification requires that the switch
of the Rd value from DB to “operating” does not transit through a state without any pull-down resistance. It
accepts a short transient during which the value of Rd is out of specified operating values. Refer to Termination
parameters section of the USB Type-C specification for full requirements.
USB Type-C
connector VBUS VBUS
Power supply
VDD
CCx CCx
CCx
Rd
CPU Type-C
Cortex CPU
(software)
STM32
Type-C source
Type-C sink application application
Controls
Step 0 0V 0V DB -
Step 1 5V 0V DB VBUS arrives
Step 2 5V 3.3 V default Rd device supply arrives
Step 3 5V 3.3 V as selected by SW upon write to ANAMODE
When the device acts as a USB Type-C source, the Rd on CCx pins must never be set to DB value. This is
ensured by keeping the DBCCx pins separate from their corresponding CCx pins and by pulling them down
through a high-value (such as 100 kΩ) external pull-down resistor, which in the unpowered state ties them low.
The solution also fits a non-protected non-Dead-battery sink application.
In both cases, when the device is powered, the DBCCx pins can be used as I/Os, as shown in Figure 16.
USB Type-C
connector VBUS VBUS
Power supply
VDD
CCx CCx
CCx
Rd
STM32
Type-C source
Type-C sink application application
Controls
USB Type-C
connector
VBUS VBUS
Power supply
VDD
CCx CCx
CCx
Rd
STM32
GPIO(s)
Type-C source
Type-C sink application application
Controls
The following table shows Dead battery mode exit sequence for a USB Type-C sink application with a protection
circuit. The term connected/isolated means CCx pins connected / non-connected with Type-C source CCx lines.
The protection circuit state active means protection activated, Rd = DB of the protection circuit exposed to Type-C
source. The protection circuit state bypassmeans protection circuit deactivated, not affecting the CC line and
connecting the device CCx pins with the Type-C source CCx lines.
Table 11. Protected sink application - sequence of exiting Dead battery mode
The protection circuit of applications not supporting Dead battery feature does not incorporate the DB pull-down
device.
It can be activated/deactivated based on its supply voltage (Figure 18) or by software through a dedicated input
(Figure 19 - control path (4)). The latter allows the device to set up, through the ANAMODE bitfield, the desired
Rd value before the protection is deactivated. In both cases, the DBCCx lines can be used as I/Os. The following
figures show examples of the application topology for either case.
Figure 18. Protected sink application not supporting Dead battery feature - activation through supply
USB Type-C
connector
VBUS VBUS
Power supply
VDD
CCx CCx
CCx
Rd
Protection
(3) DBCCx USB Type-C
(1) connector
(2)
CPU Type-C
Cortex CPU
(software)
STM32
GPIO(s)
Type-C source
Type-C sink application application
Controls
Figure 19. Protected sink application not supporting Dead battery feature - activation through dedicated
input
USB Type-C
connector
VBUS VBUS
Power supply
VDD
(4)
STM32
GPIO(s)
Type-C source
Type-C sink application application
Controls
Application DBCCx
STM32 number
Feature peripherals of STM32 External components or devices Comments Signal name
involved pins
Protocol
Communication
UCPD: CC1, Mandatory. Able to
channels CC1 and 2 - CC1, CC2
CC2 handle Rd and Rp
CC2
UCPD:
DBCC1,
Dead battery DBCC1, 2 - Handles Rd
DBCC2
DBCC2
VBUS level, Mandatory only
Resistor divider bridge with or
vSafe5V, ADC 1 for OVP protection V_SENSE
without op-amp for safety purpose
measurement purpose
Power
Sink power from Optional, LDO,
- - DC/DC from VBUS to 3.3 V (VDD) -
VBUS DC/DC, SMPS
Optional, MOSFET
Extra Power switch GPIO 1 Power switch or power switch SNK_EN
can be use
Protection
CC1 and CC2
CC1 and CC2 - - See Section 14 Recommendations Optional
on Type-C side
Vbus on Type-
VBus - - See Section 14 Recommendations Optional
C side
Software
Used to drive
See UM2552
Message repetition TIM - - timing repetition
for details
1200 µs et 900 µs
Message For TX et RX See UM2552
DMA - -
transmissions transfer for details
The following architecture schematics explain how to implement various sink modes.
VBUS
LOAD
STM32
(with UCPD)
CC2
DBCC2
VSS
USB Type-C
receptacle
Signal description
• CC1 and CC2 communication channel signals wired to dedicated Type-C connector pins
• The DBCC1 dead-battery signal is wired to CC1. This handles Rd when the STM32 is not powered via the
CC1 line.
• The DBCC2 dead-battery signal is wired to CC2. This handles Rd when the STM32 is not powered via the
CC2 line.
Optional:
• V_SENSE wired to an ADC through a resistor divider. VBUS voltage measurement for OVP and safety
purposes. The software stack, using the HAL_ADC driver, measures the VBUS voltage level.
• SNK_EN signal GPIO connects and disconnects an optional VBUS load.
Time line
V_SENSE
State 0 1 2 3 3 3 3 3 3 4 5 6 7 8 9
The states are described below. Actions in italics are GPIO-based (ADC, IO, and so on):
• State 0: No connection between equipment
– Detach state
– Rp = 1.5A Rd = 5.1K (DBCC pin)
• State 1: Connect cable; VBUS is in Attach state
• State 2: STM32 boot, start application and initialize USB-PD software
• State 3: Port partner starts AMS power negotiation
• State 4: USB-PD: use Rd from CC instead of DBCC
• State 5: SNK detects the attachment
• State 6: USB-PD: Enable load using SNK_EN GPIO and a contract is established
• State 7: USB-PD SW: OVP and safety are looking for V/I VBUS senses
• State 8: Disconnect cable, VBUS is OFF on the sink side
• State 9: Source discharges VBUS to vSafe0V
VBUS
LOAD
V_SENSE
SNK_EN
VDD GPIO ADCx_INy
Power CC1
source
DBCC1
STM32
(with UCPD)
CC2
DBCC2
VSS
USB Type-C
receptacle
Signal description
• CC1 and CC2 communication channel signals wired to dedicated Type-C connector pins
• DBCC1 signal wired to GND (as dead-battery mode is not used)
• DBCC2 signal wired to GND (as dead-battery mode is not used)
Optional:
• V_SENSE signal wired to an ADC through a resistor divider
• VBUS voltage is measured for OVP and safety purposes
• The software stack, using the HAL_ADC, measures the VBUS voltage level
SNK_EN signal GPIO pin connects and disconnects an optional VBUS load.
Time line
V_SENSE
State 0 1 2 2 2 2 2 2 3 4 5 6 7 8 9
The states are described below. Actions in italics are GPIO-based (ADC, IO and so on)
• State 0: No connection between equipment
– Detach state
– Rp = 1.5 A Rd = 5.1 K (CC pin)
• State 1: Connect cable. VBUS is in Attach state.
• State 2: AMS between SRC and SNK.
• State 3: USB-PD: Enable load using SNK_EN GPIO pin.
• State 4 SNK requests 9 V.
• State 5: USB-PD SW: OVP and safety are looking for V/I Vbus senses.
• State 6: SNK requests 15 V.
• State 7: SNK requests 5 V.
• State 8: Disconnect cable, VBUS is off on the sink side.
• State 9: Source discharge VBUS to vSafe0V.
Optional
• An STM32 GP ADC can do these measurements using a shunt or resistor bridge.
Optional protection
• Protection and EMI filtering on CC1, CC2 and VBUS lines. See Section 14 Recommendations.
Source features
The features are summarized in Table 14.
STM32 Number
Feature Peripherals of STM32 External components or devices Comments Signal name
involved pins
Protocol
CC1 and CC2 UCPD: CC1
communication 2 - Mandatory
channels CC1, CC2 CC2
UCPD:
Dead Battery DBCC1
DBCC1, 2 - Mandatory
support DBCC1
DBCC2
VBUS level,
Resistor bridge with or without op-
vSafe0V, ADC 1 Mandatory(1) V_SENSE
amp for safety purpose
measurement
Power
Mandatory,
Provide power from
GPIO 1 Power switch Dual-MOSFET SRC_EN
VBUS
can be used
Discharge VBUS to
GPIO 1 MOSFET + charge resistors Mandatory SRC_DISCH
vSafe0V
ISense
ADC 1 Op-amp + shunt resistors Optional I_SENSE
measurement
CC1 and CC2 on
CC1 and CC2 See Section 14 Recommendations
Type-C side
Protection
VBUS on Type-C
VBUS - - See Section 14 Recommendations -
side
Software
Used to drive
timing repetition
Message repetition TIM - - See [1] for details
1200 µs et 900
µs
Message For TX et RX
DMA - - See [1] for details
transmissions transfer
Figure 24 explains how to handle Source (SRC) mode. From the STM32 point of view, power is provided by an
external source such as an AC/DC, DC/DC, SMPS, LDO, or battery.
Rp management is handled by the UCPD software stack. In this case, the DBCC lines must not be wired to the
CC1 and CC2 lines. The DBCC1 and DBCC2 pins are wired to GND.
VDD
Type-C receptacle
VSS
CC1
DBCC1
STM32
(with UCPD) CC2
DBCC2
Power
source
DAC / ADC
ADCx_INy
ADCx_INx
GPIO
GPIO
SRC_EN
V and I
sensing
SRC_DISCH
Note: The VCONN circuit is not shown in this figure. See Section 13.1 Sourcing power to VBUS
.
Signal description
• CC1 and CC2 communication channel signals wired to dedicated Type-C connector pins
• the DBCC1 signal is wired to GND
• the DBCC2 signal is wired to GND
Optional:
• V_SENSE signal wired to an ADC through a resistor divider. VBUS voltage measurement for OVP and
safety purposes. Software stack, using the HAL_ADC driver to measure the VBUS voltage level.
• In the case of negative VBUS transitions, for example 15 V to 5 V or 9 V to 5 V, a discharge path can be
used before the load switch (controlled by SRC_EN) to reduce the time needed for this transition and to stay
in specification.
Time line
DISCH
V_SENSE
I_SENSE
State 0 1 2 2 2 2 2 2 3 4 5
The states are described below. Actions in italics are GPIO-based (ADC, IO, and so on):
• State 0: No connection between equipment
– Detach state
– Rp = 1.5 A, Rd = 5.1 kΩ (CC pin)
• State 1: Connect cable. VBUS is on
– Attach state
– USB-PD switches on VBUS using the SRC_EN GPIO pin
– Capability exchange
• State 2: AMS between SRC and SNK
• State 3: USB-PD SW: OVP and safety are looking for V/I VBUS senses
• State 4: Disconnect cable, VBUS is OFF on the sink side
– USB-PD initiates VBUS discharge using the DISCH GPIO pin, until VBUS reaches vSafe0V
• State 5: Source VBUS discharged to vSafe0V
Features
The features are summarized in Table 15:
STM32
Number of External components
Feature Peripherals Comments Signal name
STM32 pins or devices
involved
Protocol
VBUS
LOAD
V_SENSE
MCU
SNK_EN
DCDC/SMPS/LDO
power
USB Type-C
VDD GPIO ADCx_INw receptacle
VSS
CC1
DBCC1
STM32
(with UCPD) CC2
DBCC2
Power
source
DAC / ADC
ADCx_INx
ADCx_INy
GPIO
GPIO
SRC_EN
V and I
sensing
VBUS DC-DC
power 5V / 9V / 15V
SRC_DISCH
Note: the VCONN circuit is not shown in this figure. See Section 13.1 Sourcing power to VBUS.
The signal descriptions are given in Section 11.2.2 Sink port and Section 11.2.3 Source port.
Time line
The steps in italics are based on GPIOs (ADC, IO, and so on).
• State 0: No connection between equipment
– Detach state
– DRP = SRC role Rp = 1.5 A (CC pin)
• State 1: USB-PD stack decide to move from SRC to SNK role
– DRP = SNK role Rd = 5.1K (CC pin)
• State 2: USB-PD stack decide to move from SNK to SRC role
– DRP = SRC role Rp = 1.5A (CC pin)
• State 3: USB-PD stack decide to move from SRC to SNK role
– DRP = SNK role Rd = 5.1K (CC pin)
VBUS
LOAD
V_SENSE
MCU
SNK_EN
DCDC/SMPS/LDO
power
USB Type-C
VDD GPIO ADCx_INw receptacle
VSS
CC1
DBCC1
FRSTX_1
STM32
(with UCPD) CC2
DBCC2
Power
source FRSTX_2
DAC / ADC
ADCx_INx
ADCx_INy
GPIO
GPIO
SRC_EN
V and I
sensing
VBUS DC-DC
power 5V / 9V / 15V
SRC_DISCH
Note that the VCONN circuit is not shown in this figure. See Section 13.1 Sourcing power to VBUS.
Signal description
• The CC1 and CC2 communication channel signals wired to dedicated Type-C connector pins
• The DBCC1 signal is wired to GND.
• The DBCC2 signal is wired to GND.
• The SRC_EN signal GPIO pin is used to switch-on VBUS using an external MOSFET or power switch.
• The SRC_DISCH signal GPIO pin initiates the discharge of VBUS on detach. An external MOSFET can be
used.
• The FRSTX1 and FRSTX2 fast role swap signals are wired to external MOSFETs to drive the CC lines.
• The V_SENSE signal is wired to an ADC through a resistor divider. The VBUS voltage measurement for
OVP and safety purpose. The software stack, using the HAL_ADC driver, measures the VBUS voltage level.
• The I_SENSE signal is wired to an ADC through a resistor shunt. VBUS current measurement for safety
purposes. The software stack, using the HAL_ADC driver, measures the VBUS current level.
• The SNK_EN signal GPIO pin is used to connect and disconnect an optional VBUS load.
Time line
DISCH
V_SENSE
I_SENSE
DISCH
V_SENSE
I_SENSE
State 0 1 2 3 4 5 6 7 8 9 10 11
The steps in italics are based on GPIOs (ADC, IO, and so on)
This chapter may not fully apply to STM32 MPU products. Refer to Section 9 Product offer for their specificities.
Figure 30. Hardware view for Type-C Power Delivery with a general-purpose peripheral
Using a general-purpose peripheral, the TCPM/TCPC interfaces are a convenient way of handling USB Power
Delivery. STM32 MCUs and STM32 MPUs using a communication bus can handle all TCPM/TCPC companion
chips.
Usually the I2C, SPI or GPIOs are used to handle communication messages and exceptions.
VBUS
LOAD
MCU DCDC/SMPS/ V
power LDO sensing
SNK_EN
ADC
LDO -> 3.3 VDD
VDD
Power
source
CC1
I2C TCPC
STM32
(TCPM) GPIO CC2
USB Type-C
receptacle
TCPC
power USB Type-C
DCDC/SMPS/ VDD receptacle
MCU power LDO
CC1
VDD
I2C
SPI
STM32 GPIO TCPC
Power (TCPM) ADC
source CC2
DAC
ADC/
GPIO SRC_DISCH
DAC
ADC
ADC
SRC_EN
GND
GPIO DAC
VBUS DC-DC V/I
5 V/9 V/15 V sensing
VBUS
LOAD
USB Type-C
V receptacle
TCPC sensing
SNK_EN
power VBUS
VDD
ADC
MCU DCDC/SMPS/
power LDO
CC1
VDD
I2C
SPI
DAC
SRC_
DISCH
SRC_EN
ADC
ADC
GND
GPIO DAC
VBUS DC-DC V/I
power 5 V/9 V/15 V sensing
VBUS
This chapter may not fully apply to STM32 MPU products. Refer to Section 9 Product offer for their specificities.
Power switch
VIN AC/DC
VOUT VBUS
DC/DC
SMPS
CONTROL
ENABLE
I_SENSE
VREF
Error
STM32
general-purpose
V_SENSE
ADCx_INy VBUS sense
Signal description
• ADC: VBUS voltage and current measurement
• GPIO: power switch control, power stage enable, error sensing
• PWM or DAC: voltage reference to the power stage
• I2C: digital control of a power stage with I2C-bus.
In a STM32G0 implementation, the DC/DC converter is driven by a PWM generated with a timer (available in
the STM32,). The aim is to determine the PWM corresponding to the requested voltage. An iteration algorithm
estimates the target PWM, and a voltage measurement confirms whether the expected value is reached.
VOUT
VIN
STM32
DC/DC VREF
converter
open-drain
V3
GPIO1
V2
V1 open-drain
GPIO2
VOUT
VIN
STM32
R1
DC/DC
R2
converter VREF
PWM
open-drain
GPIO
clk
DC-DC
5V
Power Power
switch 1 switch 2
VCONN
VCONN
VCONN_EN1
USB
Type-C
CC1 CC1
DBCC1
STM32 FRSTX1
UCPD
VCONN_EN2
CC2 CC2
DBCC2
FRSTX2
Signal description
Two GPIOs (shown as VCONN_EN1 and VCONN_EN2 in the figure) control the switch to apply VCONN to the CC
lines and the simultaneous isolation of the STM32 CC pins from the CC lines.
For software details, see [1].
DISCH
V_SENSE
I_SENSE
VCONN_EN1
State 0 1 2 3 4 5 6 7 8 9
The sequence is as follows, where actions in italics are based on GPIOs (ADC, IO, and so on):
• State 0: No connection between equipment
– Detach state
– Rp = 1.5A Rd = 5.1K (CC pin)
• State 1: Connect cable. VBUS is turned on using the SRC_EN GPIO. Attach state.
– USB-PD switch on VBUS using SRC_EN GPIO pin
– capabilities exchanged
• State 2: Request VCONN ON
• State 3: Enable VCONN using VCONN_EN1/2 GPIOs
• State 4: USB-PD SW: OVP and safety are looking for V/I VBUS senses
• State 5: Request VCONN ON
• State 6: Disable VCONN using VCONN_EN1/2 GPIOs
– Start discharging CC1/2 line using FRSTX pin or a GPIO
• State 7: Disconnect cable, VBUS is OFF on the sink side
– USB Power Delivery uses the DISCH GPIO pin to initiate the VBUS discharge until the VBUS voltage
reaches vSafe0V
• State 8: The VBUS voltage reaches vSafe0V
STM32 Type-C
CC1 CC1
CC2 CC2
FRSTX1
FRSTX2
PD protocol
A SNK port or a DRP in the role of power sink measures the VBUS level to handle REQUEST_ACCEPT /
PS_RDY / DETACH protocol messages on the software side. For this purpose, one ADC is required on the
STM32 side.
A SRC port or a DRP in the role of power source provides power to the VBUS and keeps its voltage within the
specified target (through monitoring it and controlling the DC/DC converter), for PDO or APOD uses cases.
Method
To measure optional VBUS current, use a low resistance shunt. To measure VBUS voltage, use a basic resistor
bridge. Optionally add an operational amplifier for OVP and safety purposes.
Note: TSC2011 and TSC2012 precision bidirectional current sense amplifier can be used. See datasheets on
www.st.com.
Power
STM32 Type-C
MOS
CC1
TCPP0x
Rs
Isense - VBus
ADC
+ VBus
P1 VBus
R1
Vsense VBus
ADC
R2 GND
GND
Rs = shunt GND
R1, R2 = resistor divider GND
P1 = protection
Note: Extra protection (P1 in Figure 40) in can be added on Isense and Vsense. See Section 14 Recommendations.
PD3 UCPD2_DBCC2
PD1 UCPD2_DBCC1
PB5 SYS_WKUP6
PC9 GPIO_Output
PD2 UCPD2_CC2
PD0 UCPD2_CC1
PB8 I2C1_SCL
PB9 I2C1_SDA
PC10
PD6
PD5
PD4
PB7
PB6
PB4
PB3
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
PC11 1 48 PC8 GPIO_Output
PC12 2 47 PA15
PC13 3 46 PA14 SYS_SWCLK
RCC_OSC32_IN PC14 4 45 PA13 SYS_SWDIO
RCC_OSC32_OUT PC15 5 44 PA12
VBAT 6 43 PA11
VREF+ 7 42 PA10 UCPD1_DBCC2
VDD/VDDA 8 STM32G071RBTx 41 PD9
VSS/VSSA
RCC_OSC_IN PF0-OSC_IN
9
10
LQFP64 40
39
PD8
PC7
PF1-OSC_OUT 11 38 PC6
PF2-NRST 12 37 PA9 UCPD1_DBCC1
PC0 13 36 PA8 UCPD1_CC1
PC1 14 35 PB15 UCPD1_CC2
PC2 15 34 PB14
PC3 16 33 PB13
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
PC4
PC5
PB0
PB1
PB2
PB10
ADC1_IN6 PB12
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
ADC1_IN5 PB11
USART2_TX
UCPD1_ADC_VBUSC
UCPD1_ADC_PROV
USART2_RX
ADC1_IN4
ADC1_IN6
ADC1_IN7
ADC1_IN8
SYS_WKUP5
1. Mandatory
2. Optional
3. For debug purposes
14 Recommendations
Function Device
3.3 V SMLVT3V3
Power supply 5V DSDA7P120-1U1M
9 to 12 V ESDA15P60-1U1M
ESDALC6V1-1U2 (one line, pitch 350 µm)
User push button
ESDA5V3L (two lines)
Joystick ESDA6V1-5SC6 (five lines)
TVS must be selected according to the voltage on the VBUS (that can be higher than 5 V):
• ESDA7P120-1U1M for 5 V VBUS
• ESDA13P70-1U1M for 9 V VBUS
• ESDA15P60-1U1M for 12 V VBUS
• ESDA17P50-1U1M for 15 V VBUS
• ESDA25P35-1U1M for 20 V VBUS
D1 TVS T1 N-MOSFET
ESDA25P35-1U1M STL11N3LLH6
VBUS
D2
R3
GATE
IN_GD SOURCE LDO
C3 R4
R1 3.3 V
USB-C connector
VCC
VBUS_CTRL
R2
TCPP01-M12
VCC ADC
FLT GPIO2*
STM32
UCPD Low-
DB/ GPIO1 voltage
CC1 CC1c power
CC1 CC1 delivery DBCC1
CC2 CC2c controller
CC2 CC2 DBCC2
GND
C1 C2 GND
GND
* Not mandatory
D1 TVS T1 N-MOSFET
ESDA25P35-1U1M STL11N3LLH6
VBUS
Power
management
D2 OUT
R3 3.3 V
GATE
IN_GD SOURCE
C3 R4
R1
USB-C connector
VBUS_CTRL
R2
TCPP01-M12
ADC VDD
* Not mandatory
VBUS_CTRL
R2
TCPP01-M12
ADC VDD
VCC GPIO1
STM32
DB/ general purpose:
FLT GPIO2* Low-voltage
CC1 CC1c
power delivery
CC2c CC1 ADC1 controller
CC2
CC2 ADC2
C1 C2 GND GND
GND
R5 R6
5.1 kohm 5.1 kohm
* Not mandatory
Consumer path
Power
Rs
VBUS
management
ESDA25P35-1U1M
Provider path 3.3 / 5.5 V 1.8 / 3.3 V
D1 Battery
GDPG/S GDCG/S 1.8 / 3.3 V
Isense VCC/VCONN
VBUSc VCC2 VDDIO3
R3
R1 2 2
USB-C connector
I2C GPIO
R2 STM32
TCPP03-M20 R4
UCPD
CBIAS Low-voltage
FLGn GPIO power delivery
C_ESD CC1 CC1 controller
CC2 CC2
IANA ADC
CC1 CC1c ENABLE GPIO
CC2 CC2c
I2C_ADD1
GND
C1 C2 GND EXP.PAD
GND
1. I2C_ADD can be connected to GND or VddIO 2. VCC IO ring: (3.3 V +/- 10%, 5 V +/- 10%)
3. VDDIO ring: (1.8 V +/- 5%, 3.3 V +/- 10%)
Rs T1
VBUS Power supply VBUS
Rs
D1 ESDA25P35-1U1M
3.3 / 5.5 V
SRC GATE 1.8 / 3.3 V 1.8 / 3.3 V
Isense VCONN/VCC
VBUSc VCC2 VDDIO3
R1 2 2
USB-C connector
I2C GPIO
R2 STM32
TCPP02-M18
UCPD
CBIAS Low-voltage
FLGn GPIO power delivery
C_ESD CC1 CC1 controller
CC2 CC2
IANA ADC
CC1 CC1c ENABLE GPIO
CC2 CC2c
I2C_ADD1
GND
C1 C2 GND EXP.PAD
GND
1. I2C_ADD (I2C address): can be connected to GND or VddIO 2. VCC IO ring: (3.3 V +/- 10%, 5 V +/- 10%)
3. VDDIO ring: (1.8 V +/- 5%, 3.3 V +/- 10%)
TCPP01
For the TCPP01 device, the DB/ (dead battery resistor management) pin is a pulled-down active-low TCPP01
input. The DB/ pin can either be connected to VCC or driven by an MCU GPIO.
As long as the DB/ input is low (connected to ground or left open and tied low through a built-in 5 kΩ pull-down
resistor), the dead-battery resistors are connected and CC switches are opened (OFF state).
When the DB/ pin is tied to VCC, the DB resistors on the CC pins are disconnected and CC switches are closed
(ON state).
DB/ usage (sink application):
• After system power-up, the DB/ pin must be kept low, which activates DB Rd of TCPP01.
• Once the DB Rd is enabled on STM32 CC pins, the DB/ pin must be set high.
TCPP03
The dead battery management is integrated in the chip. See the Power Mode chapter in the TCPP03 data sheet
[5].
15 Additional information
The USB Power Delivery protocol over CC lines is defined as an extension to both USB2.0 and USB3.1, and only
applies to the use of the Type-C connector.
Protocol purpose
The purpose of this protocol is to negotiate the power capabilities and power requirements of the devices
connected through a USB Type-C® cable, in order to safely deliver power from the power source device to the
power sink device.
The protocol combined with the Type-C connection allows the increase of the maximum power delivery to 100 W
(5 A at 20 V).
The Power Delivery role (source or sink) is dissociated from the upstream/downstream-facing port roles. For
example, a USB device/hub (upstream-facing port) can deliver power to the USB host (downstream-facing port).
During the initial connection, the UFP is the sink and the DFP is the source. Both role pairs (source/sink and
UFP/DFP) can be swapped over the Type-C connection.
System attach
Once a debounce period has elapsed, the system becomes attached:
• On CC, Power Delivery messaging can be used for communication over CC lines
– power capabilities, for example beyond 5 V/3 A
– power-role swaps
– data role swaps (similar to HNP in OTG)
– VCONN swap
• On VCONN: on seeing an Ra resistor a 5 V supply must be provided
Revision history
Table 18. Document revision history
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1 Acronyms and abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Reference documents. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 USB Type-C in a nutshell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 USB Type-C® vocabulary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Minimum mandatory feature set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 Connector pin mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1 VBUS power options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
4 CC pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
4.1 Plug orientation/cable twist detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 Power capability detection and usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5 Power profiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
6 USB Power Delivery 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12
6.1 Power Delivery signaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.1 Packet structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.1.2 K-codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6.2 Negotiating power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
7 USB Power Delivery 3.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14
8 Alternate modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15
8.1 Alternate pin re-assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
8.2 Billboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9 Product offer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
10 Type-C with no Power Delivery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
10.1 STM32 USB2.0-only device conversion for USB Type-C platforms . . . . . . . . . . . . . . . . . . . . 19
10.2 STM32 USB2.0 host conversion for USB Type-C platforms . . . . . . . . . . . . . . . . . . . . . . . . . . 19
10.3 STM32 legacy USB2.0 OTG conversion for USB Type-C platforms. . . . . . . . . . . . . . . . . . . . 20
11 Type-C with Power Delivery using integrated UCPD peripheral . . . . . . . . . . . . . . . . . . . .22
11.1 Software overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
11.2 Hardware overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
11.2.1 DBCC1 and DBCC2 lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
11.2.2 Sink port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
11.2.3 Source port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
11.2.4 Dual-role power port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.2.5 Dual-role power port with FRS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
List of tables
Table 1. STMicroelectronics ecosystem documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Table 2. USB Type-C receptacle pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Table 3. Power supply options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Table 4. Attached device states - source perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Table 5. DFP CC termination (Rp) requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Table 6. UFP CC termination (Rd) requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Table 7. Voltage on sink CC pins (multiple source current advertisements) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Table 8. Fixed and programmable power supply current and cabling requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Table 9. USB Type-C sink behavior on CC lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 10. Non-protected sink - sequence of exiting Dead battery mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 11. Protected sink application - sequence of exiting Dead battery mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Table 12. Summary of principal Type-C application topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Table 13. Sink features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Table 14. Source features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Table 15. Dual-role power port features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Table 16. STM32G0 resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Table 17. Recommended protection devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Table 18. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
List of figures
Figure 1. USB connectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 2. Receptacle pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 3. Pull up/down CC detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 4. Power profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 5. SOP* signaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 6. Pins available for reconfiguration over the Full Featured Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 7. Pins available for reconfiguration for direct connect applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 8. USB Type-C Power Delivery block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 9. STM32G0 Discovery kit USB Type-C analyser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 10. Legacy device using USB Type-C receptacle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 11. Legacy host using USB Type-C receptacle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 12. Legacy OTG using USB Type-C receptacle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 13. USB-PD stack architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 14. Device pinout example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 15. Non-protected sink application supporting Dead battery feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 16. Non-protected sink not supporting Dead battery feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 17. Protected sink application supporting Dead battery feature. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 18. Protected sink application not supporting Dead battery feature - activation through supply . . . . . . . . . . . . . . . 28
Figure 19. Protected sink application not supporting Dead battery feature - activation through dedicated input . . . . . . . . . 28
Figure 20. Unprotected VBUS-powered (Dead battery) sink connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 21. VBUS-powered sink timeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 22. SNK external power connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 23. Sink external power time line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 24. Source architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 25. SRC (source) mode power timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 26. DRP connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 27. DRP with FRS mode time line example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 28. DRP with FRS VBUS = 5 V / 9 V / 15 V connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 29. DRP with FRS - time line example. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 30. Hardware view for Type-C Power Delivery with a general-purpose peripheral . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 31. Sink port using TCPM/TCPC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 32. Source mode using TCPM/TCPC interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 33. Dual-role power port using TCPM/TCPC interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Figure 34. Sourcing power to VBUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 35. Setting VRef with a switched resistor bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 36. Setting VRef with a PWM GPIO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 37. Applying VCONN on CC lines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 38. Applying VCONN - time line example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Figure 39. Fast role-swap DRP mode circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 40. VBUS voltage and current monitoring circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Figure 41. STM32G0 pin/resource assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 42. Entirely VBUS-powered sink. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 43. Sink application with battery (PD3.0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 44. 15 W sink application with battery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 45. Battery DRP application example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 46. SRC application using dedicated power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62