84. USB subsystem (USBSS)
In the whole document:
- • The Cortex-A35 is also called CPU1 or MPU.
- • The Cortex-M33 is also called CPU2 or MCU.
- • The Cortex- M0+ is also called CPU3.
84.1 Overview
The USB subsystem includes one USB2 host high-speed port, one USB3.0 DRD port (5 Gbit/s), and two channel configuration lines for Type-C and power delivery support.
The USB2 host high-speed port also supports full-speed (FS) and low-speed (LS) modes.
The USB3.0 DRD port can be configured statically as USB3 host or USB3 device. This port can also operate as a second USB2 host high-speed (respectively FS or LS) port, or an USB2 high-speed (respectively FS) device port, thus releasing the super-speed COMBOPHY for the PCIe controller.
The configuration channels support Type-C and power delivery features in applications where the USB3 port is connected to a Type-C receptacle.
Note: Since the USB3 port can also be used in USB2-only mode, an USB2 Type-C port can be implemented.
Figure 1043. USB subsystem overview

The diagram illustrates the USB subsystem architecture. It is organized into four main functional blocks:
- USBH (USB Host Controller): Contains 1x OHCI controller and 1x EHCI controller. It connects to USB2PHY1 via a UTMI+ interface.
- USB3DR (USB3 Device/Role): Contains 1x xHCI controller. It connects to USB2PHY2 via a UTMI+ interface and to COMBOPHY via a PIPE interface.
- COMBOPHY: A multiplexer that routes signals between USB3DR and the PCIe controller. It has four pins: COMBOPHY_TX1P, COMBOPHY_TX1N, COMBOPHY_RX1P, and COMBOPHY_RX1N.
- UCPD (USB Type-C and Power Delivery): Contains UCPD Type-C and power delivery controller. It connects to UCPDPHY1 and UCPDPHY2, which in turn connect to UCPD_CC1 and UCPD_CC2 pins.
Additional labels and connections include:
- USB2 host HS port: Associated with USB2PHY1 and its pins USBH_HS_DP and USBH_HS_DM.
- USB3 host or device port (can also be used as a second USB2 host HS port or an USB2 device port): Associated with USB2PHY2 and its pins USB3DR_DP and USB3DR_DM.
- To/from PCIe controller: Connection to the COMBOPHY block.
- Channel configuration pins for Type-C and power delivery support: Associated with UCPD_CC1 and UCPD_CC2.
Reference: MSv67501V2
84.2 USB2 host high-speed port (USBH + USB2PHY1)
84.2.1 USB2 host high-speed port main features
- • OHCI model for full-speed and low-speed operation
- • EHCI model for high-speed operation
- • LPM (link power management)
- • HS, FS, and LS modes supported by USB2PHY1(no dedicated full-speed PHY as in some MCUs).
- • DMA engine with local 512-byte packet buffer
- • Battery charging v1.2, with the exception of the accessory charger adapter mode
- • Suspend, sleep, resume, and remote wake-up operations
- • Electrical parameter override bits for optimal interoperability
The standards supported are:
- • Universal serial bus specification, rev 2.0, USB implementers forum, inc, April 27, 2000
- • Enhanced host controller interface specification for universal serial binterfus, rev 1.0, march 12, 2002
- • EHCI 1.1 addendum, version 0.6, October 2007
- • Open host controller interface specification for USB, release 1.0a, September 14, 1999
- • Engineering change notice: USB2.0 link power management addendum, July 16, 2007
- • UTMI+ specification, revision 1.0, Philips Semiconductor, February 25, 2004
- • Battery charging specification, revision 1.2, december 7, 2010
84.2.2 USB2 host high-speed port implementation
Table 855. Implementation parameters
| Parameter | STM32MP23/25xx |
|---|---|
| EHCI descriptors/data prefetching | Yes |
| Number of OHCI controller | 1 |
| Number of USB2 physical port | 1 |
| Dedicated AHB interfaces for EHCI and OHCI controllers | Yes |
| EHCI controller includes port power control | Yes |
| EHCI packet buffer depth | 512 bytes |
| Programmable packet buffer depth during runtime | Yes |
| EHCI extended capabilities pointer | 0xA0 |
| Supports EHCI asynchronous schedule park capability | Yes |
| Supports EHCI programmable frame list flag | Yes |
| 64-bit addressing capability for EHCI | No |
| Supports HSIC functionality | No |
| Supports heterogeneous interface per port | No, only UTMI+ is supported |
| ULPI interface | No |
Table 855. Implementation parameters (continued)
| Parameter | STM32MP23/25xx |
|---|---|
| UTMI legacy interface | No, UTMI+ is selected |
| OHCI powerOn to powerGood time | 2 ms |
| Is the device connected to port #1 non removable? | No |
| Supports link power management for EHCI controller | Yes |
| Supports OHCI legacy | No |
| Enhanced AHB master INCRX support | Yes |
| Supports power switching for OHCI-owned port | Yes |
| Global or per port power switching for OHCI-owned port | per port |
| Port power control mask for port #1 | 0 |
84.2.3 USB2 host high-speed port functional description
USB2 host high-speed port block diagram
Figure 1044. USB2 host high-speed port block diagram

The diagram illustrates the USB2 host high-speed port architecture. Key components and their interconnections are as follows:
- SYSCFG: Connected to the USBH block and the Polarity Control block.
- USBH: A central block containing two EHCI controller units. It has several external interfaces:
- appprt_ovrcur_i and ehci_prt_pwr_o connect to Polarity Control.
- OHCI AHB master, OHCI AHB slave, EHCI AHB master, and EHCI AHB slave connect to the Device interconnect via a vertical bus.
- utmi_suspend_o_n, ohci_0_irq_o_n, and ehci_interrupt_o connect to EXTI1 and the CPU NVICs.
- Data RAM and Descr. RAM are connected to the EHCI controllers.
- Polarity Control: Receives inputs from SYSCFG and USBH, and provides USBH_OVRCUR and USBH_VBUSEN signals to Alternate function selection.
- Alternate function selection: Manages GPIO pins for USBH_OVRCUR and USBH_VBUSEN.
- USB2PHY1: Includes a PLL and connects to the physical USB pins: USBH_HS_DP, USBH_HS_DM, and USBH_HS_TXRTUNE. It receives Control and trimming signals from SYSCFG and UTMI+ signals from USBH.
- EXTI1: Receives wake-up and interrupt signals from USBH and routes them to CPU1 GIC and CPU2 NVIC.
- CPU1 GIC and CPU2 NVIC: Handle interrupts for the USB host, including wake-up and OHCI/EHCI interrupts.
MSv67469V1
USB2 host high-speed port pins and internal signals
Table 856. USB2 host high-speed port pins
| Signal name | Signal type | Description |
|---|---|---|
| USB_HS_DP | 3.3 V analog | USB D+ signal |
| USB_HS_DM | USB D- signal | |
| USB_HS_TXRTUNE | 1.8 V analog | Transmitter resistor tune pin This analog signal connects to the ground through an external 200 Ω±1% resistor that adjusts the high-speed source impedance of USB2PHY1. |
| USBH_OVRCUR | \(V_{DDIO}\) domain | Alternate input function of a GPIO. The application can use this input to inform the USB2 host controller of an over current situation. When asserted, the USB2 host high-speed port enters disable state. This input polarity is defined by USBH_OVRCUR_POLARITY in SYSCFG_USBHCR. |
| USBH_VBUSEN | Alternate output function of a GPIO. The application can use this output to switch on or off the \(V_{BUS}\) source of the USB2 host high-speed port. This output polarity is defined by USBH_VBUSEN_POLARITY in SYSCFG_USBHCR. |
Table 857. USB2 host high-speed port internal signals
| Signal name | Signal type | Description |
|---|---|---|
| OHCI AHB master | Digital | AHB master interface to the device interconnect for memory access of OHCI engine (32-bit data width) |
| OHCI AHB slave | Digital | AHB slave interface for access to OHCI registers (32-bit data width) |
| EHCI AHB master | Digital | AHB master interface to the device interconnect for memory access of EHCI engine (32-bit data width) |
| EHCI AHB slave | Digital | AHB slave interface for access to EHCI registers (32-bit data width) |
USB2 host high-speed port resets
Figure 1045. USB2 host high-speed port reset

The diagram illustrates the reset logic for the USB2 host high-speed port. It shows the interaction between the RCC (Reset and Clock Control) block, the USBH (USB Host Controller) block, and the USB2PHY1 (USB2 Physical Layer 1) block. The RCC block generates reset signals (rst_n_usb2 and rst_n_usb2phy1) and provides clocks (ck_icn_m_usb2ehci and ck_icn_m_usb2ohci). The USBH block contains four Reset sync blocks that synchronize the reset signals with the clocks and output reset signals to the USBH. The USB2PHY1 block contains por, phyclock0, and portreset0 inputs. An Inverter block takes rst_n_usb2phy1 as input and outputs to por and portreset0.
MSv67470V2
There are two resets for the USB2 host high-speed port:
- • rst_n_usb2phy1 controlled by USB2PHY1RST in RCC_USB2PHY1CFGR
- • rst_n_usb2 controlled by USBHRST in RCC_USBHCFGR
When configuring the USB2 host high-speed port, the reset sequence to be applied is:
- 1. Assert both rst_n_usb2phy1 and rst_n_usb2.
- 2. Select the frequency of USB2PHY1 reference clock.
- 3. Program USB2PHY1 trimming bits (if needed).
- 4. Enable the clocks coming from RCC or oscillator.
- 5. Release rst_n_usb2phy1.
- 6. Wait for 50 µs (USB2PHY1 PLL lock time and start of generation of phyclock0).
- 7. Release rst_n_usb2.
Description of USB2 host controller (USBH)
See Section 86: USB2 EHCI/OHCI high/full/low-speed host controller (USBH).
Description of the USB2PHY1
USB2PHY1 is controlled by SYSCFG registers (see Section 25.2: SYSCFG registers).
84.2.4 USB2 host high-speed port interrupts
The USB2 host high-speed port generates two interrupts.
Table 858. USB2 host high-speed port interrupts
| USBH signal name | CPU1 interrupt | CPU2 interrupt |
|---|---|---|
| OHCI_0_irq_o_n | usbh_ohci_it | usbh_ohci_it |
| ehci_interrupt_0 | usbh_ehci_it | usbh_ehci_it |
The USB2 host high-speed port generates one wake-up event that can be turned into an interrupt by the EXTI. This wake-up event can be used to wake up the system from Stop mode.
Table 859. USB2 host high-speed port wake-up event
| USBH signal name | EXTI event | CPU1 interrupt | CPU2 interrupt |
|---|---|---|---|
| utmi_suspend_o_n | USBH WAKEUP | exti_usbh_cpu1_wkup | exti_usbh_cpu2_wkup |
When the USB2 host high-speed port is inactive, utmi_suspend_o_n is asserted, places USB2PHY1 in a minimal power mode, and shuts down all not necessary peripherals for the resume operation. The system can then move to Stop mode if desired.
When a remote wake-up event is received, utmi_suspend_o_n is deasserted asynchronously. This triggers the usbh_wkup event and the system wakes up from Stop mode.
The exti_usbh_cpu1_wkup (respectively exti_usbh_cpu2_wkup) interrupt is generated by the EXTI which allows the USB driver to resume operation.
84.2.5 USB2 host high-speed port programmable parameters
In addition to the polarity control of USBH_OVRCUR and USBH_VBUSEN alternate functions, and the selection of USB2PHY1 reference clock frequency, some SYSCFG bits are used to control the USB2PHY1 battery charging procedure and electrical parameters trimming.
USB2PHY1 battery charging
The USB2PHY1 integrates voltage and current sources, as well as voltage comparators required to support battery charging v1.2. The relevant control bits are in SYSCFG_USB2PHY1BCCR and SYSCFG_USB2PHY1BCSR.
The default values in SYSCFG_USB2PHY1BCCR are such that the USB2 host high-speed port behaves as a standard downstream port (SDP).
If the application wants the USB2 host high-speed port to behave as a charging downstream port (CDP), one of the following control sequences must be implemented:
- • Control sequence 1:
- a) Set H_CDPEN bit to 1.
- b) Decode the disconnect information transmitted by the USB2PHY1 to the USBH controller (HOSTDISCONNECT0 output of USB2PHY1).
If disconnect = 1, set H_VDMSRCEN to 1, otherwise set H_VDMSRCEN to 0.
- • Control sequence 2:
- a) Set H_CDPEN bit to 1 and H_CDPDETEN bit to 1.
- b) Monitor CHGDET and FSVPLUS status bits:
If CHGDET = 1 and FSVPLUS = 0, set H_VDMSRCEN to 1, otherwise set H_VDMSRCEN to 0.
Trimming of USB2PHY1 electrical parameters
Some parameters inside the USB2PHY1 can be adjusted by control bits in SYSCFG_USB2PHY1TRIM1CR and SYSCFG_USB2PHY1TRIM2CR.
These adjustments must be programmed while the USB2PHY1 is under reset. They apply to the following:
- • the internal PLL
- • the disconnect threshold
- • the squelch threshold
- • the data detection threshold
- • the transmitter high-speed crossover point
- • the FS/LS source impedance
- • the HS DC voltage level
- • the HS transmitter rise/fall times
- • the driver source impedance
- • the HS transmitter pre-emphasis current
- • the HS transmitter pre-emphasis duration
Note: Default values in SYSCFG_USB2PHY1TRIM1CR and SYSCFG_USB2PHY1TRIM2CR correspond to the recommended values.
84.2.6 Connections to SYSCFG
Table 860. Connections to SYSCFG
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| USB2PHY1SEL[2:0] | sysconf_usb2phy1_sel[2:0] | In | Select USB2PHY1 reference clock frequency |
| USB2PHY1CMN | sysconf_usb2phy1_cmn | In | Control the power down of USB2PHY1 analog blocks during suspend and sleep |
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| AUTORSMENB1 | sysconf_usb2phy1_autorsmemb_i | In | Enable USB2PHY1 auto resume mode |
| RETENABLEN1 | sysconf_usb2phy1_retenablen_i | In | Enable USB2PHY1 retention mode |
| H_FORCEBCMODE | sysconf_usb2phy1_forcebcmode | In | Force USB2PHY1 in non-driving, suspend mode (for battery charging procedure) |
| H_VDMSRCEN | sysconf_usb2phy1_h_vdatsrcenb0_i | In | Enable voltage source on USB_DM1 for CDP port (for battery charging procedure) |
| H_CDPDETEN | sysconf_usb2phy1_h_vdatdetenb0_i | In | Enable voltage detector on USB_DP1 for CDP port (for battery charging procedure) |
| H_CDPEN | sysconf_usb2phy1_chrgsel0_i | In | Enable the CDP behavior for USB2 host high-speed port (for battery charging procedure) |
| FSVMINUS | sysconf_usb2phy1_fsvminus0_o | Out | voltage level on USB_DM1 (also output of the comparison with VLGC threshold as defined in BC v1.2 standard) |
| FSVPLUS | sysconf_usb2phy1_fsvplus0_o | Out | Voltage level on USB_DP1 (also output of the comparison with VLGC threshold as defined in BC v1.2 standard) |
| CHGDET | sysconf_usb2phy1_chgdet0_o | Out | Comparison of voltage on USB_DP1 with VDAT_REF threshold as defined in BC v1.2 standard |
| USB2PHY1TXRES TUNE[1:0] | sysconf_usb2phy1_txrestune[1:0] | In | USB2PHY1 source impedance adjustment |
| USB2PHY1TXRISE TUNE[1:0] | sysconf_usb2phy1_txrisetune[1:0] | In | USB2PHY1 HS transmitter rise/fall time adjustment |
| USB2PHY1TXVREF TUNE[3:0] | sysconf_usb2phy1_txvreftune[3:0] | In | USB2PHY1 HS DC voltage level adjustment |
| USB2PHY1TXFSLS TUNE[3:0] | sysconf_usb2phy1_txfslstune[3:0] | In | USB2PHY1 FS/LS source impedance adjustment |
| USB2PHY1TXHSXV TUNE[1:0] | sysconf_usb2phy1_txhsxvtune[1:0] | In | USB2PHY1 transmitter HS crossover adjustment |
| USB2PHY1OTG TUNE[2:0] | sysconf_usb2phy1_otgtune[2:0] | In | USB2PHY1 VBUS Valid threshold adjustment |
| USB2PHY1VDATREF TUNE[1:0] | sysconf_usb2phy1_vdatreftune[1:0] | In | USB2PHY1 data detect voltage adjustment |
Table 860. Connections to SYSCFG (continued)
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| USB2PHY1SQRX TUNE[2:0] | sysconf_usb2phy1_sqrxtune[2:0] | In | USB2PHY1 squelch threshold adjustment |
| USB2PHY1COMPDIS TUNE[2:0] | sysconf_usb2phy1_compdistune[2:0] | In | USB2PHY1 disconnect threshold adjustment |
| USB2PHY1PLLP TUNE[3:0] | sysconf_usb2phy1_pllptune[3:0] | In | USB2PHY1 PLL proportional path adjustment |
| USB2PHY1PLLI TUNE[1:0] | sysconf_usb2phy1_pllitune[1:0] | In | USB2PHY1 PLL integral path adjustment |
| USB2PHY1TXPREEMP PULSETUNE | sysconf_usb2phy1_txpreemppulsetune | In | USB2PHY1 HS transmitter preemphasis duration control |
| USB2PHY1TXPREEMP AMPTUNE[1:0] | sysconf_usb2phy1_txpreempamptune[1:0] | In | USB2PHY1 HS transmitter preemphasis current control |
| USBH_VBUSEN _POLARITY | sysconf_usb2_vbusen_polarity | In | Polarity of USBH_VBUSEN alternate function |
| USBH_OVRCUR _POLARITY | sysconf_usb2_ovrcur_polarity | In | Polarity of USBH_OVRCUR alternate function |
84.3 USB3 DRD port (USB3DR + USB2PHY2 + COMBOPHY)
84.3.1 USB3 DRD (dual-role data) port main features
- • Support xHCI model.
- • The USB3 DRD port can be configured statically as a host or device port. A reset of the USB3 controller (USB3DR) is required to move from one role to the other.
- • OTG is not supported. The dynamic switch from host (respectively device) to device (respectively host) role is not supported.
- • Host negotiation protocol (HNP), role swap protocol (RSP), session request protocol (SRP), and attach detection protocol (ADP) are not supported.
- • Supports USB3 super-speed mode, as well as USB2 LS/FS/HS modes (when host), or USB2 FS/HS modes (when device).
- • Descriptor caching and data prefetching to meet system performance
- • Variable FIFO buffer allocation for each endpoint
- • Supports simultaneously 4 Gbit/s IN and 4 Gbit/s OUT bandwidth.
- • DMA engine
- • Supports the battery charging v1.2, with the exception of the accessory charger adapter mode.
The standards supported are:
- • Universal serial bus 3.0 specification, revision 1.0, November 12, 2008
- • Universal serial bus specification, rev 2.0, USB implementers forum, inc, April 27, 2000
- • Errata for “USB revision 2.0 April 27 2000” as of may 28, 2002, USB-IF
- • extensible host controller interface for universal serial bus (xHCI), rev 1.1, Intel Corp., December 20, 2013
- • UTMI+ specification, revision 1.0, ULPI working group, February 25, 2004
- • Battery charging specification, revision 1.2, December 7, 2010
- • USB3 DRD port implementation
The table below gives the main generation parameters of the USB3 DRD (USB3DR).
Table 861. USB3 DRD implementation parameters
| Parameter | STM32MP23/25xx |
|---|---|
| Controller mode of operation | Dual-role device (DRD), can be configured statically as host or device. |
| OTG support | No |
| Isochronous support | Yes |
| Battery charging support | Yes |
| Number of RAMs | 3 (Rx data FIFO, Tx data FIFO, descriptor cache) |
| Number of SS bus instance | 1 |
| Number of HS bus instance | 1 |
| Interface with high-speed PHY | UTMI+ |
| Max number of endpoints (IN and OUT) supported (device mode) | 24 |
| Max number of IN endpoints that can be active simultaneously (device mode) | 12 |
| Max number of transfer descriptors that can be cached (device mode) | 16 |
| Rx FIFO max packet size | 1024 bytes |
| Tx FIFO max packet size | 1024 bytes |
| Max number of packets for Rx FIFO | 3 |
| Burst transfer support in Tx | Yes |
| Tx FIFO depth (in number of max packets) | 3 |
| Max number of devices supported (host mode) | 64 |
| Number of cached endpoints for the SS bus instance (host mode) | 8 |
| Number of cached TRBs for each SS cached endpoint | 16 |
| Number of cached endpoints for the HS bus instance (host mode) | 10 |
| Number of cached TRBs for each HS cached endpoint | 8 |
84.3.2 USB3 DRD port functional description
USB3 DRD port block diagram
Figure 1046. USB3 DRD port block diagram

USB3 DRD port pins and internal signals
Table 862. USB3 DRD port pins
| Signal name | Signal type | Description |
|---|---|---|
| USB3DR_DP | 3.3 V analog | USB D+ signal |
| USB3DR_DM | USB D- signal | |
| USB3DR_TXRTUNE | 1.8 V analog | Transmitter resistor tune pin. This analog signal connects to the ground through an external 200 Ω ±1% resistor that adjusts the high-speed source impedance of USB2PHY2. |
| COMBOPHY_RX1P | 0.8 V analog (Vp) | Super-speed differential receiver |
| COMBOPHY_RX1N | Super-speed differential receiver |
| Signal name | Signal type | Description |
|---|---|---|
| COMBOPHY_TX1P | 0.8 V analog (Vptx) | Super-speed differential transmitter |
| COMBOPHY_TX1N | Super-speed differential transmitter | |
| COMBOPHY_REXT | analog (0 - 250 mV range) | Reference resistor. This analog signal connects to the ground through an external 200 Ω resistor (±1%, ±100 ppm/\(^{\circ}\text{C}\)) |
| USB3DR_OVRCUR | \(V_{\text{DD IO}}\) domain | Alternate input function of a GPIO. The application can use this input to inform the USB3 DRD controller of an over current situation. This input polarity is defined by USB3DR_OVRCUR_POLARITY in SYSCFG_USB3DRCR. |
| USB3DR_VBUSEN | Alternate output function of a GPIO. The application can use this output to switch on or off the \(V_{\text{BUS}}\) source of the USB3 host high-speed port. This output polarity is defined by USB3DR_VBUSEN_POLARITY in SYSCFG_USB3DRCR. |
| Signal name | Signal type | Description |
|---|---|---|
| USB3DR AXI master | Digital | AXI master interface to the device interconnect for memory access of USB3 DRD controller (64-bit data width) |
| USB3DR AHB slave | Digital | AHB slave interface for access to USB3 DRD controller registers (32-bit data width) |
| COMBOPHY APB slave | Digital | APB slave interface for access to the USB3 PCIe COMBOPHY registers (32-bit data width) |
USB3 DRD port resets
Figure 1047. USB3 DRD port reset
MSv67472V2
There are three resets for the USB3 DRD port:
- • rstn_usb2phy2 controlled by USB2PHY2RST in RCC_USB2PHY2CFGR
- • rstn_usb3dr controlled by USB3DRRST in RCC_USB3DRCFGR
- • rstn_usb3pciephy controlled by USB3PCIEPHYRST in RCC_USB3PCIEPHYCFGR
When configuring the USB3 DRD port, the reset sequence to be applied is:
- 1. Assert rstn_usb2phy2, rstn_usb3dr and rstn_usb3pciephy.
- 2. Select the frequency of USB2PHY2 reference clock.
- 3. Program the USB2PHY2 trimming bits (if needed).
- 4. Enable the clocks coming from RCC or oscillator.
- 5. Select USB3 or PCIe mode.
- 6. Select the reference clock path and frequency, and program the PLL for COMBOPHY.
- 7. Enable the reference clock buffer in the COMBOPHY.
- 8. Wait for 10 μs.
- 9. Release rstn_usb2phy2 and rstn_usb3pciephy.
- 10. Wait for 260 μs (COMBOPHY PLL lock time and start of generation of pipe0_pclk, this wait time also ensures that USB2PHY2 PLL is locked, and FREECLK is generated).
- 11. Release rst_n_usb3dr.
Description of the USB3 DRD controller (USB3DR)
See Section 85: USB3 xHCI SuperSpeed dual role controller (USB3DR).
Description of the USB2PHY2
USB2PHY2 is controlled by SYSCFG registers (see Section 25.2: SYSCFG registers).
Description of the USB3 PCIe combo PHY (COMBOPHY)
Refer to Section 90: Combo PHY (COMBOPHY) for COMBOPHY documentation.
84.3.3 USB3 DRD port interrupts
The USB3 DRD port generates two interrupts. usb3_bc_irq is unused in STM32MP23/25xx applications.
Table 864. USB3 DRD port interrupts
| USB3DR pin name | CPU1 interrupt | CPU2 interrupt |
|---|---|---|
| interrupt | usb3_irq | usb3_irq |
| bc_interrupt | usb3_bc_irq | usb3_bc_irq |
The USB3 DRD port generates two wake-up events that can be turned into interrupts by the EXTI. These wake-up events can be used to wake up the system from Stop mode.
Table 865. USB3 DRD port wake-up events
| Block pin name | EXTI event | CPU1 interrupt | CPU2 interrupt |
|---|---|---|---|
| USB3DR: utmi_suspend_n and utmi_l1_suspend_n | USB3DR WAKEUP | exti_usb3dr_cpu1_wkup | exti_usb3dr_cpu2_wkup |
| COMBOPHY: pipe0_rx_elecidle | COMBOPHY WAKEUP | exti_combophy_cpu1_wkup | exti_combophy_cpu2_wkup |
When in USB2 mode and when in suspend (respectively sleep) state, utmi_suspend_n (respectively utmi_l1_suspend_n) is asserted by USB3DR, which places USB2PHY2 in a minimal power mode, and shuts down all blocks not necessary for resume operation. The system can then move to Stop mode if desired. When a remote wake-up event is received, utmi_suspend_n (respectively utmi_l1_suspend_n) is deasserted asynchronously. This triggers the usb3dr_wkup event, and the system wakes up from Stop mode. The exti_usb3dr_cpu1_wkup (respectively exti_usb3dr_cpu2_wkup) interrupt is generated by the EXTI, which allows the USB driver to resume operation.
When in USB3 mode and when in U3 state, the system can be put in Stop mode if desired. Upon wake-up signaling received from the USB remote partner, a falling edge on pipe0_rx_elecidle indicates that the LFPS exit handshake starts, and generates a combophy_wkup event, which wakes up the system from Stop mode.
The exti_combophy_cpu1_wkup (respectively exti_combophy_cpu2_wkup) interrupt is generated by the EXTI, which allows the USB driver to resume operation.
84.3.4 USB3 DRD port programmable parameters
In addition to the polarity control of USB3DR_OVRCUR and USB3DR_VBUSEN alternate functions, and the clocks configuration, some SYSCFG bits are used to select between PCIe and USB3 mode, to control the battery charging procedure, and the trimming of electrical parameters in USB2PHY2 and COMBOPHY.
Selection between USB3 and PCIe mode
This is controlled by COMBOPHY_MODESEL[1:0] in SYSCFG_COMBOPHYCR2.
USB3 DRD battery charging
The USB2PHY2 integrates the voltage and current sources, as well as the voltage comparators required to support battery charging v1.2. The relevant control bits are implemented in the USB3DR_GBL_GGPIO register of USB3DR:
USB3DR_GBL_GGPIO bit description
Address offset: 0xC124
Reset value: 0x0000 0000
Table 866. USB3DR_GBL_GGPIO bit description
| Bits 31:23 | Reserved, must be kept at reset value. |
| Bit 22 | FORCEBCMODE: 0: Normal operation of USB2PHY2 1: USB2PHY2 is forced in non driving (opmode = 01), suspend (suspendn = 0) state. |
| Bit 21 | PD_SDET: Secondary detection enable when port is a portable device 0: Secondary detection disabled 1: Secondary detection enabled |
| Bit 20 | PD_PDET: Primary detection enable when port is a portable device 0: Primary detection disabled 1: Primary detection enabled |
| Bit 19 | PD_DCDET: Data contact detection enable when port is a portable device 0: Data contact detection disabled 1: Data contact detection enabled |
| Bit 18 | H_VDMSRCEN: Voltage source enable on USB_DM2 when port is a CDP 0: Voltage source on USB_DM2 disabled 1: Voltage source on USB_DM2 enabled |
| Bit 17 | H_CDPDETEN: Voltage detector enable on USB_DP2 when port is a CDP 0: Voltage detector on USB_DP2 disabled 1: Voltage Detector on USB_DP2 enabled |
| Bit 16 | H_CDPEN: CDP behavior enable for host port 0: CDP behavior disabled (the host port behaves as a SDP) 1: CDP behavior enabled |
| Bits 15:5 | Reserved |
| Bit 4 | Reserved |
| Bit 3 | Reserved |
| Bit 2 | FSVMINUS: Voltage level on USB_DM2 (also output of the comparison with VLGC threshold as defined in BC 1.2 standard) 0: V_USB_DM2 < VLGC threshold 1: V_USB_DM2 > VLGC threshold |
| Bit 1 | FSVPLUS: Voltage level on USB_DP2 (also output of the comparison with VLGC threshold as defined in BC 1.2 standard) 0: V_USB_DP2 < VLGC threshold 1: V_USB_DP2 > VLGC threshold |
| Bit 0 | CHGDET: Comparison of voltage on USB_DM2 (primary detection) or USB_DP2 (secondary detection) with VDAT_REF threshold as defined in BC 1.2 standard 0: V_USB_DP2 < VLGC threshold 1: V_USB_DP2 > VLGC threshold |
The control sequence to be applied depends on whether the USB3 DRD port is host or device.
Host case
If the application wants the host port to behave as a standard downstream port (SDP), the default values of H_CDPEN, H_CDPDETEN, and H_VDMSRCEN bits in USB3DR_GBL_GGPIO must be kept.
If the application wants the host port to behave as a charging downstream port (CDP), one of the following two control sequences must be implemented:
- • Control sequence 1:
- a) Set H_CDPEN bit to 1.
- b) Decode the disconnect information transmitted by the USB2PHY2 to the USB3 controller (HOSTDISCONNECT0 output of USB2PHY2).
If disconnect = 1, set H_VDMSRCEN to 1, otherwise set H_VDMSRCEN to 0.
- • Control sequence 2:
- a) Set H_CDPEN bit to 1 and H_CDPDETEN bit to 1.
- b) Monitor CHGDET and FSVPLUS status bits:
If CHGDET = 1 and FSVPLUS = 0, set H_VDMSRCEN to 1, otherwise set H_VDMSRCEN to 0.
Device case
- • Data contact detection
- a) Set PD_DCDET bit to 1. This enables a current source on USB_DP2 and pulls USB_DM2 low.
- b) If FSVPLUS is at 0 for more than \(t_{DCD\_DBNC}\) (as defined in battery charging v1.2), data contact has happened. PD_DCDET must be reset.
- • Primary detection
- a) Set PD_PDET bit to 1. This enables a voltage source on USB_DP2, and a voltage comparator on USB_DM2.
- b) If CHGDET = 0, the device is connected to a standard downstream port (SDP).
If CHGDET = 1, the device is connected to a charging downstream port (CDP) or a dedicated charging port (DCP). - c) Reset PD_PDET.
- • Secondary detection
- a) Set PD_SDET bit to 1. This enables a voltage source on USB_DM2 and a voltage comparator on USB_DP2.
- b) If CHGDET = 0, the device is connected to a charging downstream port (CDP).
Else if CHGDET = 1, the device is connected to a dedicated charging port (DCP). - c) Reset PD_SDET.
Trimming of USB2PHY2 electrical parameters
Some parameters of the USB2PHY2 PHY can be adjusted by control bits in SYSCFG_USB2PHY2TRIM1CR and SYSCFG_USB2PHY2TRIM2CR. These adjustments must be programmed while the USB2PHY2 is under reset. They apply to the following:
- • the internal PLL
- • the disconnect threshold
- • the squelch threshold
- • the data detection threshold
- • the transmitter high speed crossover point
- • the FS/LS source impedance
- • the HS DC voltage level
- • the HS transmitter rise/fall times
- • the driver source impedance
- • the HS transmitter preemphasis current
- • the HS transmitter preemphasis duration
Note: The default values in SYSCFG_USB2PHY2TRIM1CR and SYSCFG_USB2PHY2TRIM2CR correspond to the recommended values.
Trimming of COMBOPHY
Some parameters of the USB3 PCIe COMBOPHY can be adjusted by control bits in SYSCFG_COMBOPHYCR3, SYSCFG_COMBOPHYCR4, and SYSCFG_COMBOPHYCR5. These adjustments must be programmed while the COMBOPHY is under reset.
They apply to:
- • Tx de-emphasis and Tx amplitude to enable tuning at the board level for Rx eye compliance
- • Rx equalizer
- • loss of signal detector threshold and sensitivity
- • Tx termination
A calibration of Tx and Rx impedance is automatically performed when the COMBOPHY is taken out of reset. A recalibration of the COMBOPHY Tx and Rx impedance can also be forced. This is done when the COMBOPHY is out of reset with COMBOPHY_RTUNE_REQ and COMBOPHY_RTUNE_ACK bits in SYSCFG_COMBOPHYCR3 and SYSCFG_COMBOPHYSR.
ID management
Since OTG feature is not supported, no dedicated ID ball exists. If an application wants to use an ID signal to configure the USB3 DRD port in host or device mode, it must use any available GPIO configured in input mode.
VBUS management
There is no dedicated VBUS ball in STM32MP23/25xx and VBUS is therefore not measured internally. Instead an external VBUS comparator must be used to infer VBUS level or VBUS must be connected to a GPIO through a suitable voltage divider scheme.
The comparators inside USB2PHY2 must be disabled to optimize power consumption: this requires to program OTGDISABLE0 to 1 and DRVVBUS0 to 0 in SYSCFG_USB2PHY2CR register.
Figure 1048. VBUS connection diagram
![Figure 1048: VBUS connection diagram. This block diagram illustrates the VBUS management interface between the USB3DR and USB2PHY2 components. The USB3DR block on the left contains 'utmiotg_vbusvalid' and 'pipe3_PowerPresent' signals, which are connected to the 'VBUSVALID in SYSCFG_USB2PHY2CR' input of the USB2PHY2 block on the right. The USB2PHY2 block also features 'OTGDISABLE0' (connected to 'OTGDISABLE0 in SYSCFG_USB2PHY2CR', noted as 'must be programmed to 1'), 'DRVVBUS0' (connected to 'DRVVBUS0 in SYSCFG_USB2PHY2CR', noted as 'must be programmed to 0'), 'OTGSESSVLD0', 'VBUSVLDEXT0' (connected to 'VBUSVLDEXT in SYSCFG_USB2PHY2CR'), and 'VBUSVLDEXTSEL0' (connected to 'VBUSVLDEXTSEL in SYSCFG_USB2PHY2CR', noted as 'Must be programmed to 1'). A multiplexer (0/1) selects between 'OTGSESSVLD0' (labeled 'deprecated') and 'VBUSVLDEXT0' to produce 'utmisrp_bvalid' for the USB3DR. The USB3DR also contains 'Filtering logic' which receives 'bus_filter_bypass[3:0]' and outputs 'utmisrp_bvalid'. The 'FILTER_BYPASS[3:0] in SYSCFG_USB2PHY2CR' signal is also shown. The diagram is labeled 'MSv67473V2' in the bottom right corner.](/RM0457-STM32MP23-25/3829b7cd8426efed4f89f2c0523ed366_img.jpg)
The VBUS management depends on whether the USB3 DRD port is host or device.
Host mode
The VBUS valid information is provided to USB3DR on input pins utmiotg_vbusvalid and pipe3_powerPresent that are controlled by VBUSVALID in SYSCFG_USB2PHY2CR. The USB software is responsible for setting this bit to 1 when VBUS is valid.
Device mode
VBUSVLDEXTSEL must be programmed to 1 in SYSCFG_USB2PHY2CR. The VBUS valid information is provided to USB3DR on utmisrp_bvalid input pin which is controlled by VBUSVLDEXT in SYSCFG_USB2PHY2CR. The USB software is responsible for setting this bit to 1 when VBUS is valid.
Note: In device mode, utmiotg_vbusvalid and pipe3_powerPresent inputs must be set to low by writing VBUSVALID to 0 in SYSCFG_USB2PHY2CR.
84.3.5 Connections to SYSCFG
Table 867. Connections to SYSCFG
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| DRVVBUS0 | sysconf_usb2phy2_drvvbus0 | In | Control of USB2PHY2 VBUS valid comparator |
| OTGDISABLE0 | sysconf_usb2phy2_otgdisable0 | In | Disable of USB2PHY2 VBUS valid comparator |
| USB2PHY2SEL[2:0] | sysconf_usb2phy2_sel[2:0] | In | Selection of USB2PHY2 reference clock frequency |
| FILTER_BYPASS[3:0] | usb3_bus_filter_bypass[3:0] | In | Enable of internal debounce logic for the USB3 DRD port |
| VBUSVLDEXT | sysconf_usb2phy2_vbusvldext_i | In | VBUS valid comparison value when an external comparator is used |
| VBUSVLDEXTSEL | sysconf_usb2phy2_vbusvldextsel_i | In | Selection of VBUS valid comparator. Must be set to 'external'. |
| USB2PHY2CMN | sysconf_usb2phy2_cmn | In | Control of the power down of USB2PHY2 analog blocks during suspend and Sleep |
| AUTORSMENB2 | sysconf_usb2phy2_autorsmemb_i | In | Enable of USB2PHY2 auto resume mode |
| RETENABLEN2 | sysconf_usb2phy2_retenablen_i | In | Enable of USB2PHY2 retention mode |
| USB2PHY2TXRESTUNE[1:0] | sysconf_usb2phy2_txrestune[1:0] | In | USB2PHY2 source impedance adjustment |
| USB2PHY2TXRISETUNE[1:0] | sysconf_usb2phy2_txrisetune[1:0] | In | USB2PHY2 HS transmitter rise/fall time adjustment |
| USB2PHY2TXVREFTUNE[3:0] | sysconf_usb2phy2_txvreftune[3:0] | In | USB2PHY2 HS DC voltage level adjustment |
| USB2PHY2TXFSLSTUNE[3:0] | sysconf_usb2phy2_txfslstune[3:0] | In | USB2PHY2 FS/LS source impedance adjustment |
Table 867. Connections to SYSCFG (continued)
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| USB2PHY2TXHSXVTUNE[1:0] | sysconf_usb2phy2_txhsxvtune[1:0] | In | USB2PHY2 transmitter HS crossover adjustment |
| USB2PHY2OTGTUNE[2:0] | sysconf_usb2phy2_otgtune[2:0] | In | USB2PHY2 VBUS valid threshold adjustment |
| USB2PHY2VDATREFTUNE[1:0] | sysconf_usb2phy2_vdatreftune[1:0] | In | USB2PHY2 data detect voltage adjustment |
| USB2PHY2SQRXTUNE[2:0] | sysconf_usb2phy2_sqrxtune[2:0] | In | USB2PHY2 squelch threshold adjustment |
| USB2PHY2COMPDISTUNE[2:0] | sysconf_usb2phy2_compdistune[2:0] | In | USB2PHY2 disconnect threshold adjustment |
| USB2PHY2PLLPTUNE[3:0] | sysconf_usb2phy2_pllptune[3:0] | In | USB2PHY2 PLL proportional path adjustment |
| USB2PHY2PLLITUNE[1:0] | sysconf_usb2phy2_pllitune[1:0] | In | USB2PHY2 PLL integral path adjustment |
| USB2PHY2TXPREEMP PULSETUNE | sysconf_usb2phy2_txpreemppulsetune | In | USB2PHY2 HS transmitter preemphasis duration control |
| USB2PHY2TXPREEMP AMPTUNE[1:0] | sysconf_usb2phy2_txpreempamptune[1:0] | In | USB2PHY2 HS transmitter preemphasis current control |
| USB3DR_VBUSEN_POLARITY | sysconf_usb3_vbusen_polarity | In | Polarity of USB3DR_VBUSEN alternate function |
| USB3DR_OVRCUR_POLARITY | sysconf_usb3_ovrcur_polarity | In | Polarity of USB3DR_OVRCUR alternate function |
| USB3DR_HOST_PORT_POWER_CONTROL_PRESENT | sysconf_usb3_host_port_power_control_present | In | Defines the bit [3] of capability parameters (HCCPARAMS) |
| USB3DR_CLK_GATE_CTRL[2:0] | usb3_clk_gate_ctrl[2:0] | Out | Debug bits. indicate the status of the USB3 controller internal clock gating. |
| COMBOPHY_SSCRANGE[2:0] | sysconf_combophy_SSCRANGE[2:0] | In | Selection of the range of the spread spectrum modulation |
| COMBOPHY_SSCEN | sysconf_combophy_SSCEN | In | Spread spectrum enable |
| COMBOPHY_REFSSPEN | sysconf_combophy_REFSSPEN | In | Reference clock enable |
| COMBOPHY_REFCLKDIV2 | sysconf_combophy_REFCLKDIV2 | In | Parameter for the frequency selection of the USB3 PCIe combo PHY reference clock |
| COMBOPHY_SSCREFCLKSEL[8:0] | sysconf_combophy_SSCREFCLKSEL[8:0] | In | Parameter for the frequency selection of the USB3 PCIe combo PHY reference clock |
| COMBOPHY_MPLLMULTIPLIER[6:0] | sysconf_combophy_MPLLMULTIPLIER[6:0] | - | Parameter for the frequency selection of the USB3 PCIe combo PHY reference clock |
Table 867. Connections to SYSCFG (continued)
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| COMBOPHY_REFUSEPAD | sysconf_combophy_REFUSEPAD | In | Selection of the source of the USB3 PCIe combo PHY reference clock |
| COMBOPHY_TEST_POWERDOWN | sysconf_combophy_test_powerdown | In | Forces the USB3 PCIe combo PHY in its lowest power state |
| COMBOPHY_MODESEL[1:0] | sysconf_combophy_modesel[1:0] | In | Selection of the USB3 PCIe combo PHY mode (USB3 or PCIe) |
| COMBOPHY_RTUNE_REQ | sysconf_usb3pcie2phy_phy_rtune_req | In | Command bit for the USB3 PCIe combo PHY to perform a termination calibration |
| COMBOPHY_RX_LOSLFPSEN | sysconf_combophy_RXLOSLFPSEN | In | Enable the RX LOS LFPS mode. |
| COMBOPHY_PCSTX_SWINGFULL[6:0] | sysconf_combophy_PCSTXSWINGFULL[6:0] | In | TX amplitude (USB3 and PCIe use case) |
| COMBOPHY_PCSTX_DEEMPH6DB[5:0] | sysconf_combophy_PCSTXDEEMPH6DB[5:0] | In | TX deemphasis at 6 dB (USB3 use case) |
| COMBOPHY_PCSTX_DEEMPH3P5DB[5:0] | sysconf_combophy_PCSTXDEEMPH3P5DB[5:0] | In | TX deemphasis at 3.5 dB (USB3 use case) |
| COMBOPHY_PCSRX_LOSMASKVAL[9:0] | sysconf_combophy_PCSRXLOSMASKVAL[9:0] | In | Mask the incoming LFPS for the number of reference clock cycles equal to the value of this bitfield |
| COMBOPHY_TX_VBOOST_LEVEL[2:0] | sysconf_combophy_tx_vboost_lvl[2:0] | In | TX voltage boost level |
| COMBOPHY_TX_TERM_OFFSET[4:0] | sysconf_combophy_tx0_term_offset[4:0] | In | Transmitter termination offset |
| COMBOPHY_PCS_TX_SWING_LOW[6:0] | sysconf_usb3pcie2phy_tx_swing_low[6:0] | In | TX amplitude for low swing mode (PCIe use case) |
| COMBOPHY_PCS_TX_DEEMPH_GEN1[5:0] | sysconf_usb3pcie2phy_tx_deemph_gen1[5:0] | In | TX deemphasis at 3.5 dB (PCIe gen1use case) |
| COMBOPHY_LOS_BIAS[2:0] | sysconf_combophy_los_bias[2:0] | In | Control of loss of signal detector threshold |
| COMBOPHY_LOS_LEVEL[4:0] | sysconf_combophy_los_level[4:0] | In | Control of loss of signal detector sensitivity |
| COMBOPHY_RX0_EQ[2:0] | sysconf_combophy_rx0_eq[2:0] | In | RX equalizer setting |
| COMBOPHY_PIPE0_TX2RX_LOOPBK | sysconf_combophy_PIPE0TX2RX_LOOPBK | In | Debug bit. PCIe use case: controls the data loopback from transmit predriver to the receive slicers. |
| COMBOPHY_LANE0_TX2RX_LOOPBK | sysconf_combophy_LANE0TX2RXLOOPBK | In | Debug bit. USB3 use case: controls the data loopback from transmit predriver to the receive slicers. |
Table 867. Connections to SYSCFG (continued)
| SYSCFG bitfield | USBSS signal name | USBSS direction | Description |
|---|---|---|---|
| COMBOPHY_LANE0_EXT_PCLK_REQ | sysconf_usb3pcie2phy_lane0_ext_pclk_req | In | USB3 use case: external PIPE clock enable request |
| COMBOPHY_PCS_COMMON_CLOCKS | sysconf_usb3pcie2phy_pcs_common_clocks | In | Selection of a common clock mode for the PCIe receive datapath. |
| COMBOPHY_PCS_TX_DEEMPH_GEN2_6DB[5:0] | sysconf_usb3pcie2phy_pcs_tx_deemph_gen2_6db[5:0] | In | TX deemphasis at 6 dB (PCIe gen2 use case) |
| COMBOPHY_PCS_TX_DEEMPH_GEN2_3P5DB[5:0] | sysconf_usb3pcie2phy_pcs_tx_deemph_gen2_3p5db[5:0] | In | TX deemphasis at 3.5 dB (PCIe gen2use case) |
| COMBOPHY_RTUNE_ACK | sysconf_usb3pcie2phy_phy_rtune_ack | Out | Indicate the end of the termination calibration step. |
84.4 USB Type-C and power delivery interface
84.4.1 USB Type-C and power delivery interface main features
- • The USB Type-C and power delivery interface is made of CC1 and CC2 channel configuration pins. It enables the implementation of one Type-C port.
- • Supports the CC signaling of the Type-C specification:
- – Attachment detection
- – Cable orientation resolution
- – Source/sink role advertisement
- – Detection of current modes
- • Supports the physical layer of the power delivery specification and enables power negotiation, power role swap and data role swap.
- • One ADC channel must be used for \(V_{BUS}\) comparison with the thresholds defined in the Type-C and power delivery standards.
- • Supports sink, source or dual-role power (DRP) platforms.
- • Independent DMA interface for Tx and Rx functionality
- • Not supported: dead battery support, over voltage protection on CC signals and VBUS, over current detection on VBUS, VCONN switches, VBUS switch gate control and discharge. These features must be supported with external components.
- • Not supported: fast role swap (FRS).
The standards supported are:
- • Universal serial bus type-C cable and connector specification, release 2.0, august 2019
- • Universal serial bus power delivery specification:
- – Revision 2.0, v1.3, January 12 2017
- – Revision 3.0, v2.0, August 29 2019
84.4.2 USB Type-C and power delivery interface implementation
The figure below gives an overview of how STM32MP23/25xx connects to a Type-C receptacle. It shows what is supported inside device, and which external components are required.
Figure 1049. USB Type-C implementation

The diagram illustrates the USB Type-C implementation for the STM32MP25xx. It shows the internal components of the STM32MP25xx and the external components connected to a USB Type-C receptacle.
Internal Components (STM32MP25xx):
- GPIOs
- ADC
- EXTI1
- UCPD controller
- UCPDPHY (containing UCPDPHY1 and UCPDPHY2)
- EXTI2
- COMBOPHY
- GPIO
External Components:
- Resistor bridge
- VBUS source (for SRC and DRP platforms)
- VBUS switch
- TCPP04-M20 (containing Overcurrent detection, Vconn Switch, Over voltage protection, and VBUS connect)
- Super-speed switch
Connections:
- GPIOs connect to EXTI1, EXTI2, and the COMBOPHY.
- ADC connects to the Resistor bridge.
- UCPD controller connects to UCPDPHY.
- UCPDPHY connects to UCPD_CC1 and UCPD_CC2.
- COMBOPHY connects to COMBOPHY_RX1P/N and COMBOPHY_TX1P/N.
- GPIO connects to the Super-speed switch.
- Resistor bridge connects to the VBUS switch.
- VBUS source connects to the VBUS switch.
- VBUS switch connects to the USB Type-C receptacle (VBUS).
- TCPP04-M20 connects to the USB Type-C receptacle (CC1, CC2).
- Super-speed switch connects to the USB Type-C receptacle (RX1+/RX1-, RX2+/RX2-, TX1+/TX1-, TX2+/TX2-).
MSv67466V2
The CC I/Os (UCPDPHY) integrate all \(R_p\), \(R_d\) resistors, and the voltage threshold comparators that are required to define the local port attributes and detect the attributes of the remote port being attached.
The UCPD digital controller handles Type-C level detection with debounce, CRC generation/checking, 4b5b encode/decode, and BMC encode/decode.
VBUS detection and comparison with \(V_{safe5v}\) and \(V_{safe0V}\) thresholds are performed by an ADC channel. An external resistor bridge is required to scale down VBUS to the 1.8 V range of the ADC channel input.
An external super-speed switch is required to map the single set of super-speed lines provided by STM32MP23/25xx onto the dual set of super-speed lines of the Type-C receptacle. The multiplexing is controlled by a GPIO and depends on the orientation of the plug inserted in the receptacle.
Another external component is required to protect the CC lines from over voltage condition, and the VBUS line from over voltage and over current conditions. TCPP02/03 is well suited
for this purpose, and also implements Vconn switches, dead-battery support, the control for VBUS switch, and VBUS discharge.
A VBUS source is required in source (SRC) and dual role power (DRP) platforms.
In a SRC or DRP platform, the STM32MP23/25xx can be woken up from Stop mode by the UCPD digital controller upon asynchronous detection of events on the CC lines. In a sink (SNK) platform, the STM32MP23/25xx can be woken up from Standby mode by the detection of a VBUS connection, which is performed in TCPP04-M20, and routed to a GPIO (FLG_n signal in Figure 1049).
Note: Figure 1049 associates the Type-C port with the USB3 DRD port (which can also be used in USB2 mode). It could also be associated with the USB2 host only port. If an application requires two Type-C ports an external Type-C controller is required in addition to the one in STM32MP23/25xx.
84.4.3 USB Type-C and power delivery interface functional description
USB Type-C and power delivery block diagram
Figure 1050. USB Type-C and power delivery block diagram

The diagram shows the internal and external signal routing and functional blocks of the USB Type-C and Power Delivery system, including:
- UCPD controller connected via APB slave interface to the Device interconnect.
- Clock inputs from RCC:
ck_ker_req_usbtc,ck_ker_usbtc,ck_icn_p_usbtc, mapping toClkReq,Usbpdclk, andpclk. - Connections to UCPDPHY (containing
UCPDPHY1andUCPDPHY2) via Trimming of resistor values, Activation of resistors, and Status, leading to external pinsUCPD_CC1andUCPD_CC2. - Connection to ADC (for detection of VBUS connect/disconnect and comparison of VBUS to Vsafe0V / Vsafe5V thresholds), which connects to
GPIO(2). - DMA interaction with HPDMA using
UCPD_RX(rxdmaack,rxdmareq) andUCPD_TX(txdmareq,txdmaack). - Interrupt routing:
IrqAsynto EXTI1 (generatingusbtc_wkup), andIrqAllto EXTI2 (generatingEXTI2[n]). Both feed into CPU1 GIC and CPU2 NVIC viausbpd_gbl_irqandexti_exti[n]_wkupsignals.GPIO(1)also interfaces to EXTI2.
Notes:
1. For external wakeup on, for example VBUS detect or VBUS OVP/OCP.
2. For VBUS measurement.
MSv67467V3
USB Type-C and power delivery pins and internal signals
Table 868. USB Type-C and power delivery pins
| Signal name | Signal type | Description |
|---|---|---|
| UCPD_CC1 | 3V3 analog, 5V tolerant | Channel configuration |
| UCPD_CC2 | 3V3 analog, 5V tolerant | Channel configuration |
| GPIO | \(V_{DDIO}\) domain | ADC channel input for VBUS comparison to Vsafe0V threshold |
| GPIO | Wake-up input (from external TCPPO4-M20) |
Table 869. USB Type-C and power delivery internal signals
| Signal name | Signal type | Description |
|---|---|---|
| UCPD APB slave | Digital | APB slave interface for access to the UCPD controller registers (32-bit data width) |
| rxdma req | Digital | Request of UCPD_RX DMA interface |
| rxdma ack | Digital | Acknowledge of UCPD_RX DMA interface |
| txdma req | Digital | Request of UCPD_TX DMA interface |
| txdma ack | Digital | Acknowledge of UCPD_TX DMA interface |
USB Type-C and power delivery reset
Figure 1051. USB Type-C and power delivery reset

The diagram illustrates the reset logic for the USB Type-C and power delivery interface. It shows three main components: the RCC (Reset and Clock Control), the Reset sync block, and the UCPD controller. The UCPDCRST signal from the RCC controls the rstn_usbtc signal. The rstn_usbtc signal is connected to the Reset sync block, which also receives the ck_icn_p_usbtc signal. The Reset sync block then controls the presetn signal within the UCPD controller.
MSv67468V2
There is only one reset for the USB Type-C and power delivery interface:
- • rstn_usbtc controlled by UCPDCRST in RCC_UCPDCCFGR register.
Description of the USB Type-C and power delivery controller (UCPD)
Refer to Section 87: USB Type-C®/USB Power Delivery interface (UCPD).
84.4.4 USB Type-C and power delivery interrupts
The USB Type-C and power delivery interface involves one interrupt generated by the UCPD controller, and one wake-up event generated by the UCPD controller.
Table 870. USB Type-C controller interrupt| UCPD signal name | CPU1 interrupt | CPU2 interrupt |
|---|---|---|
| IrqAll | usbpd_gbl_irq | usbpd_gbl_irq |
| Block pin name | EXTI1 event | EXTI2 event | CPU1 interrupt | CPU2 interrupt |
|---|---|---|---|---|
| UCPD: IrqAsyn | UCPD WAKEUP | - | - | - |
| GPIO | - | EXTI2[n] | exti_ext[n]_wkup | exti_ext[n]_wkup |
When the system is in Stop mode, it can be woken up by the UCPD WAKEUP event. This event is generated when the UCPD controller and UCPD PHY detect some activity on one of the CC lines.
When the system is in Standby mode the UCPD controller and UCPD PHY are not powered and cannot monitor the CC lines. Waking-up the system in that case requires to perform periodic exit from Standby to monitor the CC lines or the \(V_{BUS}\) presence.
Another option for Sink platforms is to rely on an external (powered) component which detects the \(V_{BUS}\) presence and wakes up the STM32MP23/25xx through a wake-up pin.
84.4.5 Need for an ADC channel
An ADC channel is used to compare \(V_{BUS}\) to thresholds which are defined in USB Type-C and power delivery standards: vSinkDisconnect, vsafe0V, vsafe5V. This is needed for the software implementation of the Type-C state machine.
These measurements and comparisons are performed when the system is in Run mode. These measurements are not a source of wakeup of the SoC.