gitwtfhub

wtf is x-cube-usb-pd?

peng-zhihui/x-cube-usb-pd — explained in plain English

Analysis updated 2026-07-18 · repo last pushed 2018-02-14

56CAudience · developerComplexity · 5/5DormantSetup · hard

TL;DR

Firmware that turns a low-cost STM32 microcontroller into a full USB Power Delivery controller, letting a device negotiate charging voltage and speed over USB-C without a dedicated PD chip.

Mindmap

mindmap
  root((repo))
    What it does
      Implements USB-PD protocol
      Negotiates power over USB-C
      Runs on STM32F072
    Tech stack
      C
      STM32F072
      STUSB1602
    Use cases
      Build custom USB-C chargers
      Build power banks
      Smart power negotiation
    Audience
      Hardware engineers
      Firmware developers
    Variants
      Dedicated chip version
      Discrete component version

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a custom USB-C charger or power bank that negotiates voltage and current automatically.

REASON 2

Add smart USB Power Delivery support to a device using a low-cost STM32 microcontroller instead of a proprietary chip.

REASON 3

Use the discrete-component hardware variant to cut manufacturing cost on a custom power-switching design.

REASON 4

Study a real, standards-certified implementation of the USB-PD protocol as a reference.

What's in the stack?

CSTM32F072STUSB1602

How it stacks up

peng-zhihui/x-cube-usb-pdalphapixel/eric-graham-1987-juggler-raytracer-1.0redteamfortress/pplshade
Stars565454
LanguageCCC
Last pushed2018-02-14
MaintenanceDormant
Setup difficultyhardhardhard
Complexity5/52/55/5
Audiencedevelopergeneralresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1day+

Requires building or sourcing one of two certified hardware variants and flashing the STM32F072 microcontroller.

Yoink these prompts

Prompt 1
Walk me through flashing this USB-PD firmware onto an STM32F072-based board.
Prompt 2
Explain the difference between the STUSB1602 chip version and the discrete-component version of this firmware.
Prompt 3
Help me understand how USB-PD negotiation works using this firmware as a reference.
Prompt 4
What hardware do I need to build a custom USB-C charger using this open-source firmware?

Frequently asked questions

wtf is x-cube-usb-pd?

Firmware that turns a low-cost STM32 microcontroller into a full USB Power Delivery controller, letting a device negotiate charging voltage and speed over USB-C without a dedicated PD chip.

What language is x-cube-usb-pd written in?

Mainly C. The stack also includes C, STM32F072, STUSB1602.

Is x-cube-usb-pd actively maintained?

Dormant — no commits in 2+ years (last push 2018-02-14).

How hard is x-cube-usb-pd to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is x-cube-usb-pd for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.