April 2019 UM2321 Rev 2 1/83
1
UM2321
User manual
STM32CubeG0 demonstration firmware
Introduction
STM32Cube is an STMicroelectronics original initiative to significantly improve designer's
productivity by reducing development effort, time and cost. STM32Cube covers the whole
STM32 portfolio.
STM32Cube includes:
• STM32CubeMX, a graphical software configura
tion tool that allows the automatic
generation of C initialization code using graphical wizards
• STM32Cube MCU Packages, comprehensive embedded-software platforms specific to
ea
ch microcontroller series (such as STM32CubeG4 for the STM32G4 Series), which
include:
– STM32Cube hardware abstrac
tion layer (HAL), ensuring maximized portability
across the STM32 portfolio
– STM32Cube low-layer APIs, ensuring the b
est performance and footprints with a
high degree of user control over the HW
– A consistent set of middleware component
s such as FAT file system, RTOS, and
USB Power Delivery
– All embedded software utilities with full set
s of peripheral and applicative
examples
The STM32CubeG0 demonstration platform runnin
g on the STM32G081B-EVAL evaluation
board is built around the STM32Cube hardware abstraction layer (HAL) and low-layer (LL)
APIs, and board support package (BSP) components, FatFS and USB PD middleware
components. This demonstration embeds several applications showing several features
supported by the STM32G081 device and using some of the peripherals present on the
STM32G081B-EVAL evaluation board and associated daughterboard. These applications
are:
• Low-power application
• Calendar application
• Image Viewer application
• Audio application
• Thermometer application
• Files browser application
• UCPD application
www.st.com
Contents UM2321
2/83 UM2321 Rev 2
Contents
1 STM32CubeG0 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Getting started with the demonstration . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1 Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Hardware settings of the STM32G081B-EVAL . . . . . . . . . . . . . . . . . . . . 10
2.2.1 Legacy daughterboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.2 USB-C Power Delivery (UCPD) daughterboard . . . . . . . . . . . . . . . . . . 12
2.3 microSD status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4 Programming demonstration firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.1 Using binary files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4.2 Using preconfigured projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Demonstration firmware package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 Demonstration repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1 Demonstration loader folder organization . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.2 Legacy folder organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.1.3 UCPD folder organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Demonstration architecture overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.1 DemoLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.2 Legacy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.3 UCPD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.4 HAL level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.5 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2.6 Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3 STM32G081RBT6 resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.1 Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.2 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3.3 Internal memory size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3.4 External memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4 Running the demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1 Demonstration startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.1 Normal processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.2 Error cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26