An5093 Getting Started With stm32g4 Series Hardware Development Boards Stmicroelectronics
An5093 Getting Started With stm32g4 Series Hardware Development Boards Stmicroelectronics
Application note
Getting started with STM32G4 Series
hardware development boards
Introduction
This application note provides system designers with hardware implementation overview of
the development board features such as power supply, clock management, reset control,
boot mode setting and debug management.
It shows how to use STM32G4 Series microcontrollers, and describes the minimum
hardware resources required to develop an application using these products.
Detailed reference design schematics are also contained in this document with descriptions
of the main components, interfaces and modes.
Contents
1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1 Power supplies schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.1 Independent analog peripherals supply . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 USB transceivers supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.3 Battery Backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.4 Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.1.5 Dynamic voltage scaling management . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Reset and power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
2.2.1 Power-on reset (POR) / power-down reset (PDR) / Brown-Out reset
(BOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.2 Power reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.3 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2.4 Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1 Pinout compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1 HSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1.1 External crystal/ceramic resonator (HSE crystal) . . . . . . . . . . . . . . . . . 20
4.1.2 External source (HSE bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2 HSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.1 External source (LSE bypass) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6 Debug management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2 SWJ debug port (JTAG and serial wire) . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.3 Pinout and debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
6.3.1 SWJ debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
7 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.1 Printed circuit board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.2 Component position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.3 Ground and power supply (VSS, VDD, VSSA, VDDA, VREF) . . . . . . . . . . . . 28
7.4 Decoupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7.5 Other signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
7.6 Unused I/Os and features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
8 Reference design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.1 Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.2 Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.3 Boot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.4 SWD interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1.5 Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.2 Component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
List of tables
List of figures
1 General information
2 Power supplies
a. Arm is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
– VREF+ pin is not available on 32-pin packages. In this case, it is bonded to VDDA
and the internal voltage reference buffer (VREFBUF) is not available and must be
kept disabled.
VREF- is internally double bonded with VSSA.
An embedded linear voltage regulator is used to supply the internal digital power VCORE.
VCORE is the power supply for digital peripherals SRAM1, SRAM2 and CCM SRAM. The
Flash is supplied by VCORE and VDD.
VDDA domain
VDDA A/D converter
VREF+ D/A converters
Comparators
VREF+ Operational amplifiers
Voltage reference buffer
VSSA
USB transceivers
VDD domain
I/O ring
Reset block
VCORE domain
Temp. sensor
PLL, HSI16 Core
SRAM1
SRAM2
VSS Standby circuitry
CCM SRAM
(Wakeup logic, IWDG)
Digital
VDD VCORE peripherals
Voltage regulator
Flash memory
Low voltage detector
Backup domain
VBAT LSE crystal 32 KHz osc
BKP registers
RCC BDCR register
RTC
MSv45867V1
The VDDA supply can be monitored by the Peripheral Voltage Monitoring, and compared
with thresholds.
When a single supply is used, VDDA can be externally connected to VDD through the
external filtering circuit in order to ensure a noise-free VDDA reference voltage.
When the Backup domain is supplied by VDD (analog switch connected to VDD), the
following pins are available:
• PC13, PC14 and PC15, which can be used as GPIO pins
• PC13, PC14 and PC15, which can be configured by RTC or LSE
• PA0/RTC_TAMP2 and PE6/RTC_TAMP3 when they are configured by the RTC as
tamper pins
Note: Due to the fact that the analog switch can transfer only a limited amount of current (3 mA),
the use of GPIO PC13 to PC15 in output mode is restricted: the speed has to be limited to
2 MHz with a maximum load of 30 pF and these I/Os must not be used as a current source
(e.g. to drive a LED).
When the Backup domain is supplied by VBAT (analog switch connected to VBAT because
VDD is not present), the following functions are available:
• PC13, PC14 and PC15 can be controlled only by RTC or LSE (refer to reference
manual section: RTC functional description)
• PA0/RTC_TAMP2 and PE6/RTC_TAMP3 when they are configured by the RTC as
tamper pins
The voltage regulators are always enabled after a reset. Depending on the application
modes, the VCORE supply is provided either by the main regulator (MR) or by the low-power
regulator (LPR).
• In Run, Sleep and Stop 0 modes, both regulators are enabled and the main regulator
(MR) supplies full power to the VCORE domain (core, memories and digital peripherals).
• In low-power run and low-power sleep modes, the main regulator is off and the low-
power regulator (LPR) supplies low power to the VCORE domain, preserving the
contents of the registers, SRAM1, SRAM2 and CCM SRAM.
• In Stop 1 modes, the main regulator is off and the low-power regulator (LPR) supplies
low power to the VCORE domain, preserving the contents of the registers, SRAM2 and
CCM SRAM.
• In Standby mode with SRAM2 content preserved (RRS bit is set in the PWR_CR3
register), the main regulator (MR) is off and the low-power regulator (LPR) provides the
supply to SRAM2 only. The core, digital peripherals (except Standby circuitry and
Backup domain) SRAM1 and CCM SRAM are powered off.
• In Standby mode, both regulators are powered off. The contents of the registers,
SRAM1, SRAM2 and CCM SRAM is lost except for the Standby circuitry and the
Backup domain.
• In Shutdown mode, both regulators are powered off. When exiting from Shutdown
mode, a power-on reset is generated. Consequently, the contents of the registers,
SRAM1, SRAM2 and CCM SRAM is lost, except for the Backup domain.
For more details on the Brown-Out reset thresholds, refer to the electrical characteristics
section in the datasheet.
Reset
MSv36048V1
The system reset signal provided to the device is output on the NRST pin. The pulse
generator guarantees a minimum reset pulse duration of 20 µs for each internal reset
source. In case of an external reset, the reset pulse is generated while the NRST pin is
asserted low.
In case on an internal reset, the internal pull-up RPU is deactivated in order to save the
power consumption through the pull-up resistor.
DD / VDDA
VVDD DDA
R
RPU
PU
External
External NRST
Filter Systemreset
System reset
resetNRST
reset
WWDG
WWDG reset
reset
IWDG
IWDGreset
reset
Pulse Firewall reset
Firewall reset
generator Software
Softwarereset
reset
(min 20 μs) Low-power
Low-power manager
managerreset
reset
Option byte
Option loader
byte reset
loader reset
BORBORreset
reset
MS33432V3
MS33432V1
Software reset
The SYSRESETREQ bit in Cortex®-M4 Application Interrupt and Reset Control Register
must be set to force a software reset on the device (as described in STM32F3, STM32F4
and STM32L4 Series Cortex®-M4 programming manual (PM0214)).
3 Package
Package should be selected by taking into account the constraints that are strongly
dependent upon the application.
The list below summarizes the most frequent ones:
• Amount of interfaces required. Some interfaces might not be available on some
packages. Some interfaces combinations might not be possible on some packages.
• PCB technology constrains. Small pitch and high ball density could require more PCB
layers and higher class PCB.
• Package height.
• PCB available area .
• Noise emission or signal integrity of high speed interfaces.
Smaller packages usually provide better signal integrity. This is further enhanced as
Small pitch and high ball density requires multilayer PCBs which allow better
supply/ground distribution.
• Compatibility with other devices.
TFBGA100
WLCSP49
WLCSP81
UFBGA64
LQFP100
LQFP128
QFPN32
QFPN48
LQFP32
LQFP48
LQFP64
LQFP80
Packag
e type
Size
5x5 7x7 7x7 7x7 3.89x3.74 10x10 5x5 12x12 3.693x3.815 8x8 14x14 14x14
(mm)(1)
Pitch
0.5 0.5 0.5 0.5 0.4 0.5 0.5 0.5 0.4 0.8 0.5 0.5
(mm)
Height
0.6 1.6 0.6 1.6 0.59 1.6 0.6 1.6 0.59 1.1 1.6 1.6
(mm)(2)
QFPN32/LQFP32 NA YES
LQFP48 YES YES
WLCSP49 NA YES
LQFP64 YES YES
UFBGA64 NA YES
WLCSP81 YES NA
Specific pins
PC14/OSC32_IN - x - x x x x x x x x x
PC15/OSC32_OUT - x - x x x x x x x x x
PF0/OSC_IN x x x x x x x x x x x x
PF1/OSC_OUT x x x x x x x x x x x x
System related pins
PB8/BOOT0 x x x x x x x x x x x x
PG10/NRST x x x x x x x x x x x x
Supply pins
VBAT - x - x x x x x x x x x
VREF+ - x - x x x x x(1) x x x x
VDDA x x x x x x x x x x x x
VSSA x x(2) x x x x x x x x x x
(1)
Number of VDD 2 2 3 4 5 5 7 3 5 2 5
Number of VSS (1)
2 2 3 4 5 5 7 3 5 2 5
1. In the QFN48, the VSSA and VSSs are connected to the exposed pad.
2. There are two VREF+ pins in the LQFP128 package.
4 Clocks
Three different clock sources can be used to drive the system clock (SYSCLK):
• HSI16 (high speed internal) 16 MHz RC oscillator clock
• HSE oscillator clock, from 4 to 48 MHz
• PLL clock
The HSI is used as system clock source after startup from Reset.
The devices have the following additional clock sources:
• 32 KHz low speed internal RC (LSI RC) which drives the independent watchdog and
optionally the RTC used for Auto-wakeup from Stop and Standby modes.
• 32.768 KHz low speed external crystal (LSE crystal) which optionally drives the real-
time clock (RTCCLK)
• RC 48 MHz internal clock sources (HSI48) to potentially drive the USB FS, the
SDMMC and the RNG.
Each clock source can be switched on or off independently when it is not used, to optimize
power consumption
Several prescaler can be used to configure the AHB frequency, the AHB1, the APB1 and
APB2 domains. The maximum frequency of the AHB, the APB1 and the APB2 domains is
170 MHz.
OSC_IN OSC_OUT
External clock
GPIO
External souce
MSv46306V1
External clock
(available on some
package, please CK_IN
refer to the
corresponding GPIO
datasheet) External souce
MSv46307V1
OSC_IN OSC_OUT
Crystal/Ceramic
resonators
CL1 CL2
Load capacitors
MSv46308V1
• The value of REXT depends on the crystal characteristics. A typical value is in the range
of 5 to 6 RS (resonator series resistance).To fine tune the REXT value, refer to
AN2867(Oscillator design guide for ST microcontrollers)
• Load capacitance, CL, has the following formula: CL = CL1 x CL2 / (CL1 + CL2) + Cstray
where: Cstray is the pin capacitance and board or trace PCB-related capacitance.
Typically, it is between 2 pF and 7 pF. Please refer to Section 7.4: Decoupling to
minimize its value.
capability (LSEDRV=00) when the LSE is ON. However, once LSEDRV is selected, the
drive capability can not be increased if LSEON=1.
The LSERDY flag in the AHB1 peripheral clocks enable in Sleep and Stop modes register
(RCC_AHB1SMENR) indicates whether the LSE crystal is stable or not. At startup, the LSE
crystal output clock signal is not released until this bit is set by hardware. An interrupt can be
generated if enabled in the Clock interrupt enable register (RCC_CIER).
5 Boot configuration
In STM32G4 Series devices, three different boot modes can be selected through the
BOOT0 pin or the nBOOT0 bit into the FLASH_OPTR register (if the nSWBOOT0 bit is
cleared into the FLASH_OPTR register), and nBOOT1 bit in FLASH_OPTR register, as
shown in the following table.
6 Debug management
6.1 Introduction
In the SWJ-DP, the two JTAG pins of the SW-DP are multiplexed with some of the five
JTAG pins of the JTAG-DP.
The host/target interface is the hardware equipment that connects the host to the application
board. This interface is made of three components: a hardware debug tool, a SW connector
and a cable connecting the host to the debug tool.
Figure 4 shows the connection of the host to a development board.
ai14866c
The Nucleo demonstration board embeds the debug tools (ST-LINK) so it can be directly
connected to the PC through an USB cable. The ST-LINK requires by default to have an
enumeration with a host that is able to supply 100 mA to power the STM32G4 Series MCU,
hence user shall use jumper JP1 on the Nucleo board which can be set in case maximum
current consumption on U5V does not exceed 100 mA.
MSv36019V1
CN1
10 NRST
9
8
7
6
5
4
3 SWCLK/PA14
2 SWDIO/PA13
1 VDD
SWD connector STM32L4xx
MS35372V1
7 Recommendations
7.3 Ground and power supply (VSS, VDD, VSSA, VDDA, VREF)
Every block (noisy, low-level sensitive, digital, etc.) should be grounded individually, and all
ground returns should be to a single point. Loops must be avoided or have a minimum area.
In order to improve analog performance, the user must use separate supply sources for VDD
and VDDA, and place the decoupling capacitors as close as possible to the device.
The power supplies should be implemented close to the ground line to minimize the area of
the supplies loop. This is due to the fact that the supply loop acts as an antenna, and acts as
the main transmitter and receiver of EMI. All component-free PCB areas must be filled with
additional grounding to create a kind of shielding (especially when using single-layer PCBs).
7.4 Decoupling
All power supply and ground pins must be properly connected to the power supplies. These
connections, including pads, tracks and vias should have as low an impedance as possible.
This is typically achieved with thick track widths and, preferably, the use of dedicated power
supply planes in multilayer PCBs.
In addition, each power supply pair should be decoupled with filtering ceramic capacitors
(100 nF) and a Tantalum or ceramic capacitor of about 10 µF connected in parallel on the
STM32G4 Series device. Some package use a common VSS for several VDD instead of a
pair of power supply (one VSS for each VDD), in that case the capacitors must be between
each VDD and the common VSS.These capacitors need to be placed as close as possible to,
or below, the appropriate pins on the underside of the PCB. Typical values are 10 nF to
100 nF, but exact values depend on the application needs. Figure 7 shows the typical layout
of such a VDD/VSS pair.
The analog power supply (VDDA/VSSA) should be decoupled with filtering ceramic capacitor
100 nF and a Tantalum or ceramic capacitor of about 1 µF. Reference voltage pin (VREF)
should be decoupled (regarding to VSSA pin) with filtering 100 nF ceramic capacitor and a
Tantalum or ceramic capacitor of about 1 µF. These capacitor need to be placed as close as
possible to, or below, the appropriate pins on the underside of the PCB. Figure 7 shows the
typical layout of analog supply pins and reference pins.
VDD VSS
STM32L4xx
MS35373V1
8 Reference design
8.1 Description
The reference design shown in Figure 8, is based on the STM32G4 Series LQFP128.
This reference design can be tailored to any STM32G4 Series device with a different
package, using the pin correspondence given in Table 11: Reference connection for all
packages.
8.1.1 Clock
Two clock sources are used for the microcontroller:
• LSE: X2– 32.768 kHz crystal for the embedded RTC
• HSE: X1– 24 MHz crystal for the STM32G4 Series microcontroller
Refer to Section 4: Clocks.
8.1.2 Reset
The reset signal in Figure 8 is active low. The reset sources include:
• Reset button (B1)
• Debugging tools via the connector CN1
Refer to Section 2.2: Reset and power supply supervisor.
STM32G4
U1A Microcontroller 1 128-pin package
LQFP128
C8 Capacitor 100 nF 1 Ceramic capacitors (decoupling capacitors)
Tantalum / chemical / ceramic capacitor
C9 Capacitor 4.7 µF 1
(decoupling capacitor)
C6 Capacitor 1 µF 3 Ceramic capacitor (decoupling capacitor)
U1A
LQFP128
C1 C10 C11
PC14
8 1uF 100nF
PC14-OSC32_IN
PC15
9
6.8pF PC15-OSC32_OUT 43
VREF+
LSE X2 44
32 KHz VREF+
PF0 19
PF0-OSC_IN 45
C2 VDDA
PF1 20
PF1-OSC_OUT 13
VDD
VDD 47
6.8pF 64
NRST 21 VDD
PG10-NRST
C3 81
VDD
MCU 95
VDD
118
PB3
STM32G4xxx 111
VDD
20pF 98 128
PA14 VDD
HSE X1 96
PA13
PB8-BOOT0
24 MHz 99 VDD 31
PA15 6
C4 119 VBAT
R1 PB4
VSSA
VSS
VSS
VSS
VSS
VSS
VSS
VSS
VSS
390
20pF
123
12
46
63
80
94
127
30
42
110
R3
10K
R4
RESET VDD
TMS/SWDAT
TCK/SWCLK
C5 10K L1
TRST
TDO
VDD
TDI
R2 C8 C9 C6 C7
100nF (x 8) 10uF
19
1uF
17
15
13
10K
11
100nF
5
1
9
7
100nF
2
20
12
18
16
14
10
8
6
4
2
SW1
GND
GND
VDD
GND
GND
GND
GND
GND
GND
GND
Recommendation:
3
MSv48099V2
Specific pins
PC14/OSC32_IN - 3 - 3 3 3 8 8 C1 C1 C7 C9
PC15/OSC32_OUT - 4 - 4 4 4 9 9 D1 D1 D7 D9
PF0/OSC_IN 2 5 2 5 5 5 12 19 E1 E1 E7 E9
PF1/OSC_OUT 3 6 3 6 6 6 13 20 F1 E2 E6 F9
System related pins
BOOT0/PB8 31 46 31 45 61 77 95 123 B3 A3 B5 B7
NRST/PG10 4 7 4 7 7 7 14 21 D2 F3 C6 D8
PA13 (JTMS-
23 36 23 37 49 63 74 96 C7 D8 B2 B2
SWDIO)
PA14 (JTCK-
24 37 24 38 50 64 75 98 C6 B10 B3 C3
SWCLK)
Supply pins
VBAT - 1 - 1 1 1 6 6 C2 D3 B7 B9
VSSA 14 - 14 19 27 27 35 42 G4 K4 G4 H6
43,
VREF+ - 20 - 20 28 28 36 G5 K5 F3 J6
44
VDDA 15 21 15 21 29 29 37 45 H5 J5 G3 J5
13,
31,
16, 24, A1,
16, 47, D5,
23, 26, 41, 49, A9,
1, 1, 32, 64, H8, A8, D7, 32,
VDD 35, 36, 51, 66, E1,
17 17 48, 81, A1 F5, A7
48 48 62, 83, J1,
64 95, F7
80 100 J9
111,
128
30,
46, D2,
15, 23, A8,
15, 63, D6,
23, 40, 48, B2, B1,
16, Expose 16, 31, 80, E5, A6,
VSS 35, 50, 65, B7, F1,
32 d pad3 32 47, 94, E6, G2
47 61, 82, G7 H9,
63 110, E7,
79 99 J2
112, F6
127
9 Revision history
STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and
improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on
ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order
acknowledgement.
Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or
the design of Purchasers’ products.
Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product.
ST and the ST logo are trademarks of ST. For additional information about ST trademarks, please refer to www.st.com/trademarks. All other
product or service names are the property of their respective owners.
Information in this document supersedes and replaces information previously supplied in any prior versions of this document.