x cube usb pd

USB Type-C™ & Power Delivery
firmware solution based on
STM32F0
X-CUBE-USB-PD
The Re-Evolution of USB
From a data interface to a primary provider of power with a data interface
USB Type-C™
One port to rule them all
Type-C
Power
Delivery
Alternate
Mode
USB IF
A smart and green technology
• More flexibility with a new reversible & thinner connector
• More power with USB Power Delivery (100 W)
• More protocols (Display Port, HDMI, VGA, Ethernet…)
• More speed with USB 3.1 gen 2 (10 Gbit/s)
2
Type-C pinout functions
Receptacle
Plug
3
ST chipset & system architecture
A complete offer to “lean in” USB Type-C PD ecosystem
SuperSpeed
Switch for
Alternate Mode
SBUx
Scalable offer for USB-PD controller and TypeC interface: from STM32 general-purpose MCU
to hard-coded solution
USB 3.x
Rx/Tx pairs
Protections
Video
CTRL
USB2
Dp/Dn
Type-C
receptacle
Authentication
USB PD
Controller
(MCU or
ASSP)
Power
Management
Type-C
Interface
(PHY)
CC lines
Historical best-in-class technologies for highperformance power conversion solutions
VBUS
Highly secure solution using STSAFE secure
element family for strong authentication needs
Protections
Host
USB
3.1
CTRL,
AP, etc
Large product portfolio for protection and
filtering covering all application needs
4
Type-C™ and USB PD solutions
Designers need high flexibility to ensure the best compatibility
Highest flexibility and
adaptability with GP
STM32 MCU for multiport management
Device policy
manager
Any
Policy engine
STM32F0
STM32
MCU
MCUs
+
Highest integration with
high-voltage
USB-C and PD
controllers (STUSBXX)
Protocol layer
+
4b5b, CRC, SoP
X-CUBE-USB-PD
USB PD
Controller
STUSB47
Auto-Run
BMC encoder
USB PD
RX/TX analog PHY
Type-C
Interface
Discrete
Analog
Front End PHY
Type-C
Controller
STUSB1602
High Voltage
Analog
1
2
3
1. Flexibility with X-CUBE-USB-PD embedded software for STM32F0 using discrete Analog Front End PHY
2. A mix of integration and flexibility using companion Type-C™ controller with STM32
3. 100% hardware solution with STUSB47 PD controller optimized for AC adapters
5
Typical use cases
Using an STM32 MCU as USB PD controller
USB
Type-C
USB
Power
Delivery
Alternate
Mode
USB-C
•
Market-proven and flexible combo solutions using STM32
MCU platform to design Provider, Consumer, Dual-role
devices or accessories.
•
Reference designs with open-source firmware libraries for
USB-C AC chargers, multi-functions protocol converters
using Alternate Mode command.
DisplayPort to HDMI
protocol converter
HDMI
6
X-CUBE-USB-PD
Certified embedded software solution
• Firmware implementation of USB Type-CTM 1.2 and USB PD 2.0
specifications – Certified by USB.org
X-CUBE-USB-PD
• Based on entry-level STM32F0 Cortex-M0 MCU
• Support for up to 2 ports (Consumer/Provider/ DRP)
•
•
CC lines
1 port (Provider/Consumer/Dual-role): STM32F051 (32-pin) recommended
2 ports (Provider/Consumer/Dual-role) or Alternate Mode: STM32F072 (48-pin)
recommended (with USB 2.0 FS interface as peripheral in one port)
• Requires a very simple Analog Front End to interface with the CC lines
• Discovery and development tool STM32 NUCLEO Pack available for
$49.90 (P-NUCLEO-USB001)
7
What does embedded software do ?
X-CUBE-USB-PD main functions
• Configure and monitor the CC lines to establish provider and consumer
roles between two port partners
• Detect attach/detach sequences between port partners
• Resolve plug orientation and twist connections for USB data bus
routing
• Establish power relationship between two ports
• Detect port partner current capability
• Drive VCONN switch and SuperSpeed switches for flippable connector
or AM
• Communicate with Port Partner using PD protocol
• Establish power contract negotiation between two attached ports
• Handle vendor-defined messages and Alternate Mode commands

USB PD
device policy
manager

USB PD
policy engine



USB PD
protocol layer
4b5b, CRC, SoP
STM32F0
MCU
GPI/Os
BMC encoder
USB PD
RX/TX analog PHY
Type-C
Interface
CC lines
Discrete
Analog
Front End
8
STM32F0 HW/FW resources
• TX/RX BMC(*) transceiver uses: 1 embedded comparator,
timers, SPI, GPIO and DMA peripherals
• Embedded ADC for device detection and power measurements
• CRC to evaluate message’s checksum
• Standard GP I/Os to control VCONN, load switch, VBUS discharge
switch, VOUT selection or to control other specific application
tasks
(*) USB PD uses half-duplex, 300 Kbit/s, 4b5b bi-phase mark coded signaling over CC wire
Memory footprint
budget (IAR)
1 port (Provider - DFP)
(ex.: AC adapter)
1 DRP (Cons+Prov)
(ex.: Notebook)
Flash size
25/30 Kbytes
27/32 Kbytes
RAM size
4.4 Kbytes
6 Kbytes
9
Analog Front End (AFE)
Ex.: 1 consumer port with captive cable using STM32F0
AFE
Tx
Rd (UFP)
Rx
USB-C
PA2/PA4 I/O structure
• Simple implementation using only 2R +1C (per CC
line)
• STM32F0 embedded comparator COMP1 on pin PA2
is used to monitor CC level while receiving BMC data.
PB4 mapped as SPI MISO is used to transmit BMC
data.
10
P-NUCLEO-USB001
STM32 Nucleo pack
• Development kit to learn and develop USB Type-CTM solutions
• Support two Dual-role ports (DRP)
• Based on Nucleo-F072 with USB-C PD expansion board
• Demonstration firmware example (provider / consumer)
• USB2.0 device peripheral capability on one port
• Ordering code: P-NUCLEO-USB001 @ $49.90 (RRP)
Note: full-featured USB Type-C cable (3A) included
11
STM32 Nucleo pack overview
USB-C PD expansion board
NUCLEO-F072RB
Device policy
manager
Policy engine
Protocol layer
Physical layer
(4b5b, CRC,
SOP, BMC)
12
X-CUBE-USB-PD stack
• Full-featured & highly customizable package based on
STM32Cube and Analog Front End
Application (DPM)
• Compliant with USB Type-C™ 1.2 and PD 2.0
specifications
STM32 USB-C PD Stack
(PRL + PE + HAL)
STM32Cube
FreeRTOS
Analog Front End (AFE)
• VCONN swap, dead battery, BIST, and VDM features
supported
• Supports up to 2 USB Type-C ports (provider, consumer
or dual-role)
113
Summary
Features
 2 USB-C supported
•
•
•
•
•
Provider/Consumer/DRP
Cable detection and orientation
Attach/detach, role of port partners
Current capability detection
PD communication + VDM
 Power management control via
standard I/Os
 Versatile set of peripherals (ADC,
DAC, SMBUS, I2C, USB 2.0)
 Authentication and security features
(AES 128, ROP, RNG, etc. )
 Firmware upgrade
Benefits
Flexibility to support various topologies.
Adaptability vs USB standard evolution
Combo solution
Overhead in MIPS and resources to implement other
applications specific tasks than USB-C, such as power
management control, voltage-current sensing, USB 2.0
peripheral interface, and house-keeping functions
Authentication ready with STSAFE secureelement
Ensure business or brand protection with safety use by port
partner identification to release full-feature capability
14
Software distribution
Type
Binary library distribution, with examples and drivers in source code
Runs on STM32 microcontrollers only
License
Binary under MCD-ST Ultimate Liberty V2
Source code under open source BSD or MCD-ST Ultimate Liberty V2
Certification
Fully certified solution (provider)
Location
Available for download on www.st.com/x-cube, once users are logged in
Note: Library sources can be obtained under NDA upon demand to nearest ST sales office:
• Library sources will be provided under MCD-ST Liberty License V2 that prevents source
redistribution
• User can modify library sources, but changes would require a re-certification
15
Thank you
www.st.com/x-nucleo
www.st.com/x-cube
16