How stmicroelectronics/x-cube-usb-pd works
X-CUBE-USB-PD is an STM32F0 firmware package for USB Type-C port management and USB Power Delivery. In the EVAL_FUSB307_DRP example, startup initializes the PD Device Policy Manager (DPM) and its application policy; the stack manages negotiation through a board TCPM/TCPCI adapter and FUSB305 controller. The package also provides optional GUI reporting/control and tracing. The graph emphasizes those product capabilities; implementation links for unsampled user-policy and power-management code are left unverified where the excerpts do not establish calls.
Main entry points: usbpd_dpm_core.c DPM core · gui_api.c GUI interface · main.c Application startup · usbpd_dpm_user.c User policy
Components 19
Example application
- Application startup
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/main.c - User policy
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/usbpd_dpm_user.c - Power interface
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/usbpd_pwr_if.c - VDM policy
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/usbpd_vdm_user.c
PD stack
- DPM core
Middlewares/ST/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c - PD core API
Middlewares/ST/STM32_USBPD_Library/Core/inc/usbpd_core.h - TCPCI interface
Drivers/BSP/STM32F0xx-Nucleo/usbpd_tcpci.h - PD timers
Drivers/BSP/STM32F0xx-Nucleo/TCPM/usbpd_timersserver.c
Board hardware
- Board TCPCI
Drivers/BSP/STM32F0xx-Nucleo/usbpd_tcpci.c - FUSB305 driver
Drivers/BSP/Components/fusb307/fusb305.c - Nucleo BSP
Drivers/BSP/STM32F0xx-Nucleo/stm32f0xx_nucleo.c
Utilities
- GUI interface
Utilities/GUI_INTERFACE/gui_api.c - GUI transport
Utilities/GUI_INTERFACE/bsp_gui.c - TLV encoding
Utilities/GUI_INTERFACE/data_struct_tlv.c - Embedded tracer
Utilities/TRACER_EMB/tracer_emb.c - Tracer hardware
Utilities/TRACER_EMB/tracer_emb_hw.c
Other components
- Firmware host
- FUSB305 controller
- Computer
Connections 20
- Firmware host → Application startup: starts
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/main.c - Application startup → DPM core: initializes
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/main.c - Application startup → User policy: initializes
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/main.c - Application startup → GUI interface: initializes optionally
Projects/STM32F072RB-Nucleo/Applications/USB_PD/EVAL_FUSB307_DRP/Src/main.c - DPM core → PD core API: uses API
Middlewares/ST/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c - DPM core → User policy: dispatches policy
Middlewares/ST/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c - DPM core → TCPCI interface: uses interface
Middlewares/ST/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c - DPM core → PD timers: uses timers
Middlewares/ST/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c - User policy → Power interface: coordinates power
- User policy → VDM policy: coordinates VDM
- TCPCI interface → Board TCPCI: implemented by
- Board TCPCI → FUSB305 driver: uses driver
- FUSB305 driver → FUSB305 controller: accesses
Drivers/BSP/Components/fusb307/fusb305.c - Board TCPCI → Nucleo BSP: uses board support
- GUI interface → PD core API: reads PD state
Utilities/GUI_INTERFACE/gui_api.c - GUI interface → TLV encoding: encodes messages
Utilities/GUI_INTERFACE/gui_api.c - GUI interface → GUI transport: sends GUI data
- GUI transport → Computer: UART communication
- GUI interface → Embedded tracer: uses tracing
- Embedded tracer → Tracer hardware: delegates hardware
Utilities/TRACER_EMB/tracer_emb.c