A cross-platform Electron desktop application for real-time monitoring and analysis of USB Power Delivery (PD) communication captured by STM32 UCPD hardware.
It reads .cpd binary streams produced by STM32CubeMonitor-UCPD and decodes them against the USB PD Revision 3.2, Version 1.0 (2023-10) specification — providing a live Connection View, a fully-decoded message table, and clipboard-ready export.
The STM32G071B-DISCO board from STMicroelectronics includes a UCPD SPY mode that passively captures USB PD packets on the CC line and streams them to a host PC via USB-UART as .cpd binary data, using the companion tool STM32CubeMonitor-UCPD (USB PD 2.0/3.0). UCPD-Monitor accepts the same .cpd stream and decodes it using a parser built from scratch against USB PD Rev 3.2 — covering EPR, AVS, extended messages, and Source_Info — without requiring STM32CubeMonitor-UCPD.
Reference: STM32CubeMonitor-UCPD on st.com · RN0113 Release Note
- Live Serial Monitoring — Connect to any STM32 UCPD device via USB-UART and receive PD frames in real time
.cpdFile Import — Drag-and-drop or open.cpdbinary files captured by STM32CubeMonitor-UCPD; server-side parsing eliminates ring-buffer mismatches. The current Live log is automatically cleared before import and import data is never duplicated into the session file.- USB PD Rev 3.2 Decoder — Full decode of Control, Data, and Extended messages including EPR, PPS, AVS, and SPR-AVS. Structured VDM (Discover Identity / SVIDs / Modes) fully decoded per §6.4.4.3 with per-field binary notation and vendor name lookup (Lenovo, Google, Apple, STMicro, Intel …).
- Connection View — Visual topology of Source / Cable (eMarker) / Sink. SOURCE node shows confirmed output voltage and current/power after PS_RDY. SINK node shows V.req (requested voltage) and calculated power. PDO grids display
I.max/P.maxfor Source PDOs andI.op/P.opfor Sink PDOs, matching USB PD Rev 3.2 semantics. Spec badges (SrcSpecBadge / SinkSpecBadge) display vendor name, PID, EPR RDY, Cap_Ext, VDM, and PDP — Cap_Ext lights only when the corresponding Extended Capabilities message is actually received. - Message Table — High-performance virtual scroll (@tanstack/react-virtual) handles 1 000 + rows smoothly. Expandable PDO/RDO child rows with O(n) RDO-to-source-PDO resolution. VDM 2-level collapsible tree: Discover Identity section headers (ID HEADER, CERT STAT, PRODUCT, UFP VDO …) are individually expandable with ▸ / ▾ toggles. Column widths are user-resizable; the rightmost "Parsed" column auto-fills the remaining window width and is stable across tree-expand and window resize.
- Row Selection & Clipboard Copy — Click / Shift-click range selection; Ctrl+C or right-click to copy rows as TSV (with
DATA:HEXraw suffix) - Auto-scroll with Jump-to-Latest — Automatic scroll to newest message; floats a button to return after manual browsing
- Session File Save — Live frames are automatically written to a timestamped
.cpdfile for later replay. The serial port is cleanly disconnected and the session file flushed on application quit. - Unknown Packet Log — Unrecognised frames are appended to
logs/unknown_packets.yamlfor diagnostics - Panel Toggles — Show/hide Connection View and Console panels independently
| Component | Technology |
|---|---|
| Desktop shell | Electron 41 |
| UI | React 19 + Vite 8 |
| State management | Zustand |
| Virtual scroll | @tanstack/react-virtual |
| Backend | Express 4 + Node.js |
| Real-time transport | WebSocket (ws) |
| Serial communication | serialport 13 |
| Packaging | electron-builder |
Download the latest installer from the Releases page and run it.
| Platform | File |
|---|---|
| Windows | NSIS installer (.exe) |
| Linux | AppImage |
After installation, launch UCPD-Monitor.
- Plug the STM32 UCPD device into a USB port.
- Select the COM port from the dropdown in the title bar.
- Click Connect. Live PD frames appear immediately.
- Click the .cpd Import button in the title bar, or
- Drag and drop one or more
.cpdfiles anywhere onto the window.
The entire file is parsed server-side and replayed as a HISTORY message — DETACHED/ATTACHED events are preserved and no ring-buffer truncation occurs.
- Click a row to select it. Shift-click to extend the selection.
- Press Ctrl+C or right-click and choose Copy N rows.
Each row is copied as a tab-separated line:
#id Timestamp Dir SOP Rev MsgID Type #DO Parsed Summary DATA:HEXRAW
Rows without a parsed summary show the raw payload as DATA:HEXRAW directly in the summary column.
GoodCRC, Accept, Reject, PS_RDY, Soft_Reset, Hard_Reset, DR_Swap, PR_Swap, VCONN_Swap, Wait, Not_Supported, Get_Source_Cap, Get_Sink_Cap, Get_Source_Cap_Extended, Get_Status, FR_Swap, Get_PPS_Status, Data_Reset, and EPR control messages.
Source_Capabilities, Sink_Capabilities, Request, EPR_Request, BIST, Alert, Battery_Status, Get_Country_Info, Enter_USB, EPR_Mode, Source_Info, Revision, VDM (Structured — Discover Identity / SVIDs / Modes with full per-field decode per PD Rev 3.2 §6.4.4.3, Tables 6.34 / 6.38–6.45).
Source_Capabilities_Extended (SCEDB), Status, PPS_Status, Battery_Capabilities, Manufacturer_Info, Sink_Capabilities_Extended, Country_Info, Country_Codes, Security_, Firmware_Update_, Extended_Control.
Fixed, Variable, Battery, APDO (PPS), APDO (AVS), APDO (SPR-AVS) — all with full field decode.
- Source PDOs display I.max / P.max; Sink PDOs display I.op / P.op per USB PD Rev 3.2 terminology.
- Battery RDO carries power fields in 250 mW units (
opPower_mW/limPower_mW). - GiveBack flag dynamically switches Max/Min labels in RDO child rows.
MIT
- STM32CubeMonitor-UCPD — Original monitoring tool by STMicroelectronics
- USB Power Delivery Specification Rev 3.2