84. USB subsystem (USBSS)

In the whole document:

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

Block diagram of Figure 1043: USB subsystem overview showing USBH (1x OHCI controller, 1x EHCI controller) connected via UTMI+ to USB2PHY1 with USBH_HS_DP and USBH_HS_DM pins to USB2 host HS port; USB3DR (1x xHCI controller) connected via UTMI+ to USB2PHY2 with USB3DR_DP and USB3DR_DM pins, and via PIPE to COMBOPHY connected to PCIe controller and COMBOPHY_TX1P, TX1N, RX1P, RX1N pins forming USB3 host or device port; and UCPD Type-C and power delivery controller connected to UCPDPHY1/2 with UCPD_CC1/2 pins for Type-C and power delivery support.

The diagram illustrates the USB subsystem architecture. It is organized into four main functional blocks:

Additional labels and connections include:

Reference: MSv67501V2

Block diagram of Figure 1043: USB subsystem overview showing USBH (1x OHCI controller, 1x EHCI controller) connected via UTMI+ to USB2PHY1 with USBH_HS_DP and USBH_HS_DM pins to USB2 host HS port; USB3DR (1x xHCI controller) connected via UTMI+ to USB2PHY2 with USB3DR_DP and USB3DR_DM pins, and via PIPE to COMBOPHY connected to PCIe controller and COMBOPHY_TX1P, TX1N, RX1P, RX1N pins forming USB3 host or device port; and UCPD Type-C and power delivery controller connected to UCPDPHY1/2 with UCPD_CC1/2 pins for Type-C and power delivery support.

84.2 USB2 host high-speed port (USBH + USB2PHY1)

84.2.1 USB2 host high-speed port main features

The standards supported are:

84.2.2 USB2 host high-speed port implementation

Table 855. Implementation parameters

ParameterSTM32MP23/25xx
EHCI descriptors/data prefetchingYes
Number of OHCI controller1
Number of USB2 physical port1
Dedicated AHB interfaces for EHCI and OHCI controllersYes
EHCI controller includes port power controlYes
EHCI packet buffer depth512 bytes
Programmable packet buffer depth during runtimeYes
EHCI extended capabilities pointer0xA0
Supports EHCI asynchronous schedule park capabilityYes
Supports EHCI programmable frame list flagYes
64-bit addressing capability for EHCINo
Supports HSIC functionalityNo
Supports heterogeneous interface per portNo, only UTMI+ is supported
ULPI interfaceNo

Table 855. Implementation parameters (continued)

ParameterSTM32MP23/25xx
UTMI legacy interfaceNo, UTMI+ is selected
OHCI powerOn to powerGood time2 ms
Is the device connected to port #1 non removable?No
Supports link power management for EHCI controllerYes
Supports OHCI legacyNo
Enhanced AHB master INCRX supportYes
Supports power switching for OHCI-owned portYes
Global or per port power switching for OHCI-owned portper port
Port power control mask for port #10

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

Block diagram of the USB2 host high-speed port showing connections between SYSCFG, USBH (with OHCI and EHCI controllers), USB2PHY1, EXTI1, and CPU NVICs.

The diagram illustrates the USB2 host high-speed port architecture. Key components and their interconnections are as follows:

MSv67469V1

Block diagram of the USB2 host high-speed port showing connections between SYSCFG, USBH (with OHCI and EHCI controllers), USB2PHY1, EXTI1, and CPU NVICs.

USB2 host high-speed port pins and internal signals

Table 856. USB2 host high-speed port pins

Signal nameSignal typeDescription
USB_HS_DP3.3 V analogUSB D+ signal
USB_HS_DMUSB D- signal
USB_HS_TXRTUNE1.8 V analogTransmitter 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}\) domainAlternate 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_VBUSENAlternate 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 nameSignal typeDescription
OHCI AHB masterDigitalAHB master interface to the device interconnect for memory access of OHCI engine (32-bit data width)
OHCI AHB slaveDigitalAHB slave interface for access to OHCI registers (32-bit data width)
EHCI AHB masterDigitalAHB master interface to the device interconnect for memory access of EHCI engine (32-bit data width)
EHCI AHB slaveDigitalAHB 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

Block diagram of USB2 host high-speed port reset logic. The RCC block contains USBHRST, USB2PHY1RST, and clock signals ck_icn_m_usb2ehci and ck_icn_m_usb2ohci. USBHRST controls rst_n_usb2, and USB2PHY1RST controls rst_n_usb2phy1. The USBH block contains four Reset sync blocks that receive rst_n_usb2 and the clock signals, and output ehci_hreset_i_n, ohci_hreset_i_n, phy_rst_i_n, and utmi_reset_i_n. The USB2PHY1 block contains por, phyclock0, and portreset0 inputs. An Inverter block takes rst_n_usb2phy1 as input and outputs to por and portreset0.

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.

Block diagram of USB2 host high-speed port reset logic. The RCC block contains USBHRST, USB2PHY1RST, and clock signals ck_icn_m_usb2ehci and ck_icn_m_usb2ohci. USBHRST controls rst_n_usb2, and USB2PHY1RST controls rst_n_usb2phy1. The USBH block contains four Reset sync blocks that receive rst_n_usb2 and the clock signals, and output ehci_hreset_i_n, ohci_hreset_i_n, phy_rst_i_n, and utmi_reset_i_n. 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:

When configuring the USB2 host high-speed port, the reset sequence to be applied is:

  1. 1. Assert both rst_n_usb2phy1 and rst_n_usb2.
  2. 2. Select the frequency of USB2PHY1 reference clock.
  3. 3. Program USB2PHY1 trimming bits (if needed).
  4. 4. Enable the clocks coming from RCC or oscillator.
  5. 5. Release rst_n_usb2phy1.
  6. 6. Wait for 50 µs (USB2PHY1 PLL lock time and start of generation of phyclock0).
  7. 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 nameCPU1 interruptCPU2 interrupt
OHCI_0_irq_o_nusbh_ohci_itusbh_ohci_it
ehci_interrupt_0usbh_ehci_itusbh_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 nameEXTI eventCPU1 interruptCPU2 interrupt
utmi_suspend_o_nUSBH WAKEUPexti_usbh_cpu1_wkupexti_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:

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:

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 bitfieldUSBSS signal nameUSBSS directionDescription
USB2PHY1SEL[2:0]sysconf_usb2phy1_sel[2:0]InSelect USB2PHY1 reference clock frequency
USB2PHY1CMNsysconf_usb2phy1_cmnInControl the power down of USB2PHY1 analog blocks during suspend and sleep
Table 860. Connections to SYSCFG (continued)
SYSCFG bitfieldUSBSS signal nameUSBSS
direction
Description
AUTORSMENB1sysconf_usb2phy1_autorsmemb_iInEnable USB2PHY1 auto resume mode
RETENABLEN1sysconf_usb2phy1_retenablen_iInEnable USB2PHY1 retention mode
H_FORCEBCMODEsysconf_usb2phy1_forcebcmodeInForce USB2PHY1 in non-driving, suspend mode (for battery charging procedure)
H_VDMSRCENsysconf_usb2phy1_h_vdatsrcenb0_iInEnable voltage source on USB_DM1 for CDP port (for battery charging procedure)
H_CDPDETENsysconf_usb2phy1_h_vdatdetenb0_iInEnable voltage detector on USB_DP1 for CDP port (for battery charging procedure)
H_CDPENsysconf_usb2phy1_chrgsel0_iInEnable the CDP behavior for USB2 host high-speed port (for battery charging procedure)
FSVMINUSsysconf_usb2phy1_fsvminus0_oOutvoltage level on USB_DM1 (also output of the comparison with VLGC threshold as defined in BC v1.2 standard)
FSVPLUSsysconf_usb2phy1_fsvplus0_oOutVoltage level on USB_DP1 (also output of the comparison with VLGC threshold as defined in BC v1.2 standard)
CHGDETsysconf_usb2phy1_chgdet0_oOutComparison 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]InUSB2PHY1 source impedance adjustment
USB2PHY1TXRISE
TUNE[1:0]
sysconf_usb2phy1_txrisetune[1:0]InUSB2PHY1 HS transmitter rise/fall time adjustment
USB2PHY1TXVREF
TUNE[3:0]
sysconf_usb2phy1_txvreftune[3:0]InUSB2PHY1 HS DC voltage level adjustment
USB2PHY1TXFSLS
TUNE[3:0]
sysconf_usb2phy1_txfslstune[3:0]InUSB2PHY1 FS/LS source impedance adjustment
USB2PHY1TXHSXV
TUNE[1:0]
sysconf_usb2phy1_txhsxvtune[1:0]InUSB2PHY1 transmitter HS crossover adjustment
USB2PHY1OTG
TUNE[2:0]
sysconf_usb2phy1_otgtune[2:0]InUSB2PHY1 VBUS Valid threshold adjustment
USB2PHY1VDATREF
TUNE[1:0]
sysconf_usb2phy1_vdatreftune[1:0]InUSB2PHY1 data detect voltage adjustment

Table 860. Connections to SYSCFG (continued)

SYSCFG bitfieldUSBSS signal nameUSBSS directionDescription
USB2PHY1SQRX TUNE[2:0]sysconf_usb2phy1_sqrxtune[2:0]InUSB2PHY1 squelch threshold adjustment
USB2PHY1COMPDIS TUNE[2:0]sysconf_usb2phy1_compdistune[2:0]InUSB2PHY1 disconnect threshold adjustment
USB2PHY1PLLP TUNE[3:0]sysconf_usb2phy1_pllptune[3:0]InUSB2PHY1 PLL proportional path adjustment
USB2PHY1PLLI TUNE[1:0]sysconf_usb2phy1_pllitune[1:0]InUSB2PHY1 PLL integral path adjustment
USB2PHY1TXPREEMP PULSETUNEsysconf_usb2phy1_txpreemppulsetuneInUSB2PHY1 HS transmitter preemphasis duration control
USB2PHY1TXPREEMP AMPTUNE[1:0]sysconf_usb2phy1_txpreempamptune[1:0]InUSB2PHY1 HS transmitter preemphasis current control
USBH_VBUSEN _POLARITYsysconf_usb2_vbusen_polarityInPolarity of USBH_VBUSEN alternate function
USBH_OVRCUR _POLARITYsysconf_usb2_ovrcur_polarityInPolarity of USBH_OVRCUR alternate function

84.3 USB3 DRD port (USB3DR + USB2PHY2 + COMBOPHY)

84.3.1 USB3 DRD (dual-role data) port main features

The standards supported are:

The table below gives the main generation parameters of the USB3 DRD (USB3DR).

Table 861. USB3 DRD implementation parameters

ParameterSTM32MP23/25xx
Controller mode of operationDual-role device (DRD), can be configured statically as host or device.
OTG supportNo
Isochronous supportYes
Battery charging supportYes
Number of RAMs3 (Rx data FIFO, Tx data FIFO, descriptor cache)
Number of SS bus instance1
Number of HS bus instance1
Interface with high-speed PHYUTMI+
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 size1024 bytes
Tx FIFO max packet size1024 bytes
Max number of packets for Rx FIFO3
Burst transfer support in TxYes
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 endpoint16
Number of cached endpoints for the HS bus instance (host mode)10
Number of cached TRBs for each HS cached endpoint8

84.3.2 USB3 DRD port functional description

USB3 DRD port block diagram

Figure 1046. USB3 DRD port block diagram

Figure 1046. USB3 DRD port block diagram showing SYSCFG, Control logic, USB3DR core (with xHCI, FIFO/RAMs), USB2PHY2, COMBOPHY, EXTI1, CPU1 GIC, CPU2 NVIC and external pin connections such as USB3DR_DP/DM, TXRTUNE, COMBOPHY_RX/TX/REXT, etc.
Figure 1046. USB3 DRD port block diagram showing SYSCFG, Control logic, USB3DR core (with xHCI, FIFO/RAMs), USB2PHY2, COMBOPHY, EXTI1, CPU1 GIC, CPU2 NVIC and external pin connections such as USB3DR_DP/DM, TXRTUNE, COMBOPHY_RX/TX/REXT, etc.

USB3 DRD port pins and internal signals

Table 862. USB3 DRD port pins

Signal nameSignal typeDescription
USB3DR_DP3.3 V
analog
USB D+ signal
USB3DR_DMUSB D- signal
USB3DR_TXRTUNE1.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_RX1P0.8 V
analog (Vp)
Super-speed differential receiver
COMBOPHY_RX1NSuper-speed differential receiver
Table 862. USB3 DRD port pins (continued)
Signal nameSignal typeDescription
COMBOPHY_TX1P0.8 V analog (Vptx)Super-speed differential transmitter
COMBOPHY_TX1NSuper-speed differential transmitter
COMBOPHY_REXTanalog (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}}\) domainAlternate 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_VBUSENAlternate 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.
Table 863. USB3 DRD port internal signals
Signal nameSignal typeDescription
USB3DR AXI masterDigitalAXI master interface to the device interconnect for memory access of USB3 DRD controller (64-bit data width)
USB3DR AHB slaveDigitalAHB slave interface for access to USB3 DRD controller registers (32-bit data width)
COMBOPHY APB slaveDigitalAPB slave interface for access to the USB3 PCIe COMBOPHY registers (32-bit data width)

USB3 DRD port resets

Figure 1047. USB3 DRD port reset Figure 1047. USB3 DRD port reset diagram showing RCC reset controls to USB2PHY2, USB3DR, and COMBOPHY blocks.

MSv67472V2

Figure 1047. USB3 DRD port reset diagram showing RCC reset controls to USB2PHY2, USB3DR, and COMBOPHY blocks.

There are three resets for the USB3 DRD port:

When configuring the USB3 DRD port, the reset sequence to be applied is:

  1. 1. Assert rstn_usb2phy2, rstn_usb3dr and rstn_usb3pciephy.
  2. 2. Select the frequency of USB2PHY2 reference clock.
  3. 3. Program the USB2PHY2 trimming bits (if needed).
  4. 4. Enable the clocks coming from RCC or oscillator.
  5. 5. Select USB3 or PCIe mode.
  6. 6. Select the reference clock path and frequency, and program the PLL for COMBOPHY.
  7. 7. Enable the reference clock buffer in the COMBOPHY.
  8. 8. Wait for 10 μs.
  9. 9. Release rstn_usb2phy2 and rstn_usb3pciephy.
  10. 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. 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 nameCPU1 interruptCPU2 interrupt
interruptusb3_irqusb3_irq
bc_interruptusb3_bc_irqusb3_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 nameEXTI eventCPU1 interruptCPU2 interrupt
USB3DR:
utmi_suspend_n and
utmi_l1_suspend_n
USB3DR
WAKEUP
exti_usb3dr_cpu1_wkupexti_usb3dr_cpu2_wkup
COMBOPHY:
pipe0_rx_elecidle
COMBOPHY
WAKEUP
exti_combophy_cpu1_wkupexti_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:23Reserved, must be kept at reset value.
Bit 22FORCEBCMODE:
0: Normal operation of USB2PHY2
1: USB2PHY2 is forced in non driving (opmode = 01), suspend (suspendn = 0) state.
Bit 21PD_SDET: Secondary detection enable when port is a portable device
0: Secondary detection disabled
1: Secondary detection enabled
Bit 20PD_PDET: Primary detection enable when port is a portable device
0: Primary detection disabled
1: Primary detection enabled
Bit 19PD_DCDET: Data contact detection enable when port is a portable device
0: Data contact detection disabled
1: Data contact detection enabled
Bit 18H_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 17H_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 16H_CDPEN: CDP behavior enable for host port
0: CDP behavior disabled (the host port behaves as a SDP)
1: CDP behavior enabled
Bits 15:5Reserved
Bit 4Reserved
Bit 3Reserved
Table 866. USB3DR_GBL_GGPIO bit description (continued)
Bit 2FSVMINUS: 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 1FSVPLUS: 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 0CHGDET: 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:

Device case

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:

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:

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.
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.

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 bitfieldUSBSS signal nameUSBSS directionDescription
DRVVBUS0sysconf_usb2phy2_drvvbus0InControl of USB2PHY2 VBUS valid comparator
OTGDISABLE0sysconf_usb2phy2_otgdisable0InDisable of USB2PHY2 VBUS valid comparator
USB2PHY2SEL[2:0]sysconf_usb2phy2_sel[2:0]InSelection of USB2PHY2 reference clock frequency
FILTER_BYPASS[3:0]usb3_bus_filter_bypass[3:0]InEnable of internal debounce logic for the USB3 DRD port
VBUSVLDEXTsysconf_usb2phy2_vbusvldext_iInVBUS valid comparison value when an external comparator is used
VBUSVLDEXTSELsysconf_usb2phy2_vbusvldextsel_iInSelection of VBUS valid comparator. Must be set to 'external'.
USB2PHY2CMNsysconf_usb2phy2_cmnInControl of the power down of USB2PHY2 analog blocks during suspend and Sleep
AUTORSMENB2sysconf_usb2phy2_autorsmemb_iInEnable of USB2PHY2 auto resume mode
RETENABLEN2sysconf_usb2phy2_retenablen_iInEnable of USB2PHY2 retention mode
USB2PHY2TXRESTUNE[1:0]sysconf_usb2phy2_txrestune[1:0]InUSB2PHY2 source impedance adjustment
USB2PHY2TXRISETUNE[1:0]sysconf_usb2phy2_txrisetune[1:0]InUSB2PHY2 HS transmitter rise/fall time adjustment
USB2PHY2TXVREFTUNE[3:0]sysconf_usb2phy2_txvreftune[3:0]InUSB2PHY2 HS DC voltage level adjustment
USB2PHY2TXFSLSTUNE[3:0]sysconf_usb2phy2_txfslstune[3:0]InUSB2PHY2 FS/LS source impedance adjustment

Table 867. Connections to SYSCFG (continued)

SYSCFG bitfieldUSBSS signal nameUSBSS directionDescription
USB2PHY2TXHSXVTUNE[1:0]sysconf_usb2phy2_txhsxvtune[1:0]InUSB2PHY2 transmitter HS crossover adjustment
USB2PHY2OTGTUNE[2:0]sysconf_usb2phy2_otgtune[2:0]InUSB2PHY2 VBUS valid threshold adjustment
USB2PHY2VDATREFTUNE[1:0]sysconf_usb2phy2_vdatreftune[1:0]InUSB2PHY2 data detect voltage adjustment
USB2PHY2SQRXTUNE[2:0]sysconf_usb2phy2_sqrxtune[2:0]InUSB2PHY2 squelch threshold adjustment
USB2PHY2COMPDISTUNE[2:0]sysconf_usb2phy2_compdistune[2:0]InUSB2PHY2 disconnect threshold adjustment
USB2PHY2PLLPTUNE[3:0]sysconf_usb2phy2_pllptune[3:0]InUSB2PHY2 PLL proportional path adjustment
USB2PHY2PLLITUNE[1:0]sysconf_usb2phy2_pllitune[1:0]InUSB2PHY2 PLL integral path adjustment
USB2PHY2TXPREEMP PULSETUNEsysconf_usb2phy2_txpreemppulsetuneInUSB2PHY2 HS transmitter preemphasis duration control
USB2PHY2TXPREEMP AMPTUNE[1:0]sysconf_usb2phy2_txpreempamptune[1:0]InUSB2PHY2 HS transmitter preemphasis current control
USB3DR_VBUSEN_POLARITYsysconf_usb3_vbusen_polarityInPolarity of USB3DR_VBUSEN alternate function
USB3DR_OVRCUR_POLARITYsysconf_usb3_ovrcur_polarityInPolarity of USB3DR_OVRCUR alternate function
USB3DR_HOST_PORT_POWER_CONTROL_PRESENTsysconf_usb3_host_port_power_control_presentInDefines the bit [3] of capability parameters (HCCPARAMS)
USB3DR_CLK_GATE_CTRL[2:0]usb3_clk_gate_ctrl[2:0]OutDebug bits. indicate the status of the USB3 controller internal clock gating.
COMBOPHY_SSCRANGE[2:0]sysconf_combophy_SSCRANGE[2:0]InSelection of the range of the spread spectrum modulation
COMBOPHY_SSCENsysconf_combophy_SSCENInSpread spectrum enable
COMBOPHY_REFSSPENsysconf_combophy_REFSSPENInReference clock enable
COMBOPHY_REFCLKDIV2sysconf_combophy_REFCLKDIV2InParameter for the frequency selection of the USB3 PCIe combo PHY reference clock
COMBOPHY_SSCREFCLKSEL[8:0]sysconf_combophy_SSCREFCLKSEL[8:0]InParameter 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 bitfieldUSBSS signal nameUSBSS directionDescription
COMBOPHY_REFUSEPADsysconf_combophy_REFUSEPADInSelection of the source of the USB3 PCIe combo PHY reference clock
COMBOPHY_TEST_POWERDOWNsysconf_combophy_test_powerdownInForces the USB3 PCIe combo PHY in its lowest power state
COMBOPHY_MODESEL[1:0]sysconf_combophy_modesel[1:0]InSelection of the USB3 PCIe combo PHY mode (USB3 or PCIe)
COMBOPHY_RTUNE_REQsysconf_usb3pcie2phy_phy_rtune_reqInCommand bit for the USB3 PCIe combo PHY to perform a termination calibration
COMBOPHY_RX_LOSLFPSENsysconf_combophy_RXLOSLFPSENInEnable the RX LOS LFPS mode.
COMBOPHY_PCSTX_SWINGFULL[6:0]sysconf_combophy_PCSTXSWINGFULL[6:0]InTX amplitude (USB3 and PCIe use case)
COMBOPHY_PCSTX_DEEMPH6DB[5:0]sysconf_combophy_PCSTXDEEMPH6DB[5:0]InTX deemphasis at 6 dB (USB3 use case)
COMBOPHY_PCSTX_DEEMPH3P5DB[5:0]sysconf_combophy_PCSTXDEEMPH3P5DB[5:0]InTX deemphasis at 3.5 dB (USB3 use case)
COMBOPHY_PCSRX_LOSMASKVAL[9:0]sysconf_combophy_PCSRXLOSMASKVAL[9:0]InMask 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]InTX voltage boost level
COMBOPHY_TX_TERM_OFFSET[4:0]sysconf_combophy_tx0_term_offset[4:0]InTransmitter termination offset
COMBOPHY_PCS_TX_SWING_LOW[6:0]sysconf_usb3pcie2phy_tx_swing_low[6:0]InTX amplitude for low swing mode (PCIe use case)
COMBOPHY_PCS_TX_DEEMPH_GEN1[5:0]sysconf_usb3pcie2phy_tx_deemph_gen1[5:0]InTX deemphasis at 3.5 dB (PCIe gen1use case)
COMBOPHY_LOS_BIAS[2:0]sysconf_combophy_los_bias[2:0]InControl of loss of signal detector threshold
COMBOPHY_LOS_LEVEL[4:0]sysconf_combophy_los_level[4:0]InControl of loss of signal detector sensitivity
COMBOPHY_RX0_EQ[2:0]sysconf_combophy_rx0_eq[2:0]InRX equalizer setting
COMBOPHY_PIPE0_TX2RX_LOOPBKsysconf_combophy_PIPE0TX2RX_LOOPBKInDebug bit. PCIe use case: controls the data loopback from transmit predriver to the receive slicers.
COMBOPHY_LANE0_TX2RX_LOOPBKsysconf_combophy_LANE0TX2RXLOOPBKInDebug bit. USB3 use case: controls the data loopback from transmit predriver to the receive slicers.

Table 867. Connections to SYSCFG (continued)

SYSCFG bitfieldUSBSS signal nameUSBSS directionDescription
COMBOPHY_LANE0_EXT_PCLK_REQsysconf_usb3pcie2phy_lane0_ext_pclk_reqInUSB3 use case: external PIPE clock enable request
COMBOPHY_PCS_COMMON_CLOCKSsysconf_usb3pcie2phy_pcs_common_clocksInSelection 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]InTX 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]InTX deemphasis at 3.5 dB (PCIe gen2use case)
COMBOPHY_RTUNE_ACKsysconf_usb3pcie2phy_phy_rtune_ackOutIndicate 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 standards supported are:

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

Block diagram of USB Type-C implementation showing internal STM32MP25xx components and external components connected to a USB Type-C receptacle.

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):

External Components:

Connections:

MSv67466V2

Block diagram of USB Type-C implementation showing internal STM32MP25xx components and external components connected to a USB Type-C receptacle.

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

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:

Notes:
1. For external wakeup on, for example VBUS detect or VBUS OVP/OCP.
2. For VBUS measurement.

Figure 1050. USB Type-C and power delivery block diagram

MSv67467V3

USB Type-C and power delivery pins and internal signals

Table 868. USB Type-C and power delivery pins

Signal nameSignal typeDescription
UCPD_CC13V3 analog, 5V tolerantChannel configuration
UCPD_CC23V3 analog, 5V tolerantChannel configuration
GPIO\(V_{DDIO}\) domainADC channel input for VBUS comparison to Vsafe0V threshold
GPIOWake-up input (from external TCPPO4-M20)

Table 869. USB Type-C and power delivery internal signals

Signal nameSignal typeDescription
UCPD APB slaveDigitalAPB slave interface for access to the UCPD controller registers (32-bit data width)
rxdma reqDigitalRequest of UCPD_RX DMA interface
rxdma ackDigitalAcknowledge of UCPD_RX DMA interface
txdma reqDigitalRequest of UCPD_TX DMA interface
txdma ackDigitalAcknowledge of UCPD_TX DMA interface

USB Type-C and power delivery reset

Figure 1051. USB Type-C and power delivery reset

Block diagram showing the reset mechanism for the USB Type-C and power delivery interface. The RCC block contains the UCPDCRST signal, which controls the rstn_usbtc signal. The rstn_usbtc signal is connected to the Reset sync block, which in turn controls the presetn signal within the UCPD controller block. The ck_icn_p_usbtc signal is also connected to the Reset sync block.

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

Block diagram showing the reset mechanism for the USB Type-C and power delivery interface. The RCC block contains the UCPDCRST signal, which controls the rstn_usbtc signal. The rstn_usbtc signal is connected to the Reset sync block, which in turn controls the presetn signal within the UCPD controller block. The ck_icn_p_usbtc signal is also connected to the Reset sync block.

There is only one reset for the USB Type-C and power delivery interface:

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 nameCPU1 interruptCPU2 interrupt
IrqAllusbpd_gbl_irqusbpd_gbl_irq
Table 871. USB Type-C and power delivery events
Block pin nameEXTI1 eventEXTI2 eventCPU1 interruptCPU2 interrupt
UCPD: IrqAsynUCPD WAKEUP---
GPIO-EXTI2[n]exti_ext[n]_wkupexti_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.