April 2019 UM2546 Rev 2 1/30
1
UM2546
User manual
STM32G071B-DISCO USB-C Discovery kit
Introduction
The STM32G071B-DISCO USB-C Discovery kit comes on top of the STM32Cube as a
firmware package that offers a full set of software components based on a modular
architecture allowing each module to be used separately in standalone sink applications.
The STM32G071B-DISCO USB-C Discovery kit may be executed in two different modes
depending on the position of the switch: standalone sink mode, or spy mode. The spy mode
does not use the USBPD stack. In this mode, the protocol information on the CC lines is
decoded, and no protocol action may be triggered. But in the standalone sink mode, some
protocol actions may be executed.
In both modes, the UCPD block port 1 is used, and may give an example for a customer
application.
The STM32G071B-DISCO USB-C Discovery kit has been designed to run on
STM32G071B-DISCO (MB1378).
Figure 1. STM32G071B-DISCO USB-C Discovery kit
www.st.com
Contents UM2546
2/30 UM2546 Rev 2
Contents
1 Demonstration description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 Demonstration package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Demonstration architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.1 Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.2 HAL level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2.3 Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 STM32G071RB resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.3.1 Hardware resources used by the UCPD demonstration . . . . . . . . . . . . . 9
1.3.2 Peripherals used by the UCPD demonstration . . . . . . . . . . . . . . . . . . . 10
1.3.3 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2 Demonstration functional description . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.1 Demo startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.1.1 Normal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2 UCPD demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.1 Mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.2 LED indications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3 Hardware settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1 STM32G071B-DISCO board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
4 Software settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1 Clock Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 Programming the demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.1 Using Binary file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2.2 Using preconfigured projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5 Software description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1 Demonstration Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.2 Application overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.2.1 Spy mode case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.2.2 Standalone sink case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.2.3 Demonstration menu details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.2.4 STM32CubeMonitor USB Type-C PD tool with G0 Discovery kit . . . . . 22