AN4080
Application note
Getting started with STM32F0x1/x2/x8
hardware development
Introduction
This application note is intended for system designers who require a hardware
implementation overview of the development board features such as the power supply, the
clock management, the reset control, the boot mode settings and the debug management. It
shows how to use the STM32F0xxxx product family and describes the minimum hardware
resources required to develop your application.
Within the STM32F0xxxx product family, the STM32F0x8 line offers a different embedded
power management to support 1.8 V operation.
This document also includes detailed reference design schematics with the description of
the main components, interfaces and modes.
Table 1. Applicable products
Type
Part number
STM32F031C4, STM32F031C6, STM32F031F4, STM32F031F6,
STM32F031G4, STM32F031G6, STM32F031K4, STM32F031K6,
STM32F038C6, STM32F038F6, STM32F038G6, STM32F038K6,
STM32F042C4, STM32F042C6, STM32F042F4, STM32F042F6,
STM32F042G4, STM32F042G6, STM32F042K4, STM32F042K6,
STM32F042T4, STM32F042T6,
STM32F048C6, STM32F048G6, STM32F048T6
STM32F051C4, STM32F051C6, STM32F051C8,
STM32F051K4, STM32F051K6, STM32F051K8,
STM32F051R4, STM32F051R6, STM32F051R8,
STM32F058C8, STM32F058R8,
STM32F071V8, STM32F071CB, STM32F071RB, STM32F071VB,
STM32F072C8, STM32F072R8, STM32F072V8,
STM32F072CB,STM32F072RB, STM32F072VB,
STM32F078CB, STM32F078RB, STM32F078VB,
STM32F091CB, STM32F091RB, STM32F091VB,
STM32F091CC, STM32F091RC, STM32F091VC,
STM32F098CC, STM32F098RC, STM32F098VC
Microcontrollers
Note:
In this document, the notation used for devices is STM32F0xx where xx are the two first
digits following F0 standing for entry-level family. Pin count and memory size d not impact
this hardware description.
November 2014
DocID023035 Rev 4
1/35
www.st.com
1
Contents
AN4080
Contents
1
Power supplies and reset sources of the
STM32F0xx family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1
Power supply schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1
1.1.2
1.1.3
Independent analog converter supply . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Battery backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Power-on reset (POR) / power-down reset (PDR) of the STM32F0x1/x2
devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
External power-on reset and power-down reset (NPOR) of the
STM32F0x8 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Programmable voltage detector (PVD) of the STM32F0x1/x2
devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.2
Reset and power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.2.1
1.2.2
1.2.3
1.2.4
2
Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1
2.2
2.3
2.4
2.5
2.6
High speed external clock signal (HSE) OSC clock . . . . . . . . . . . . . . . . . 16
LSE clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
HSI 8 MHz clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
LSI clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
ADC clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
HSI 48 MHz clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.6.1
2.6.2
HSI 48 MHz RC oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
HSI 48 MHz clock recovery system (CRS) . . . . . . . . . . . . . . . . . . . . . . 19
2.7
Clock security system (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3
4
Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Debug management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.1
4.2
4.3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
SWD port (serial wire debug) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Pinout and debug port pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3.1
4.3.2
Serial wire debug (SWD) pin assignment . . . . . . . . . . . . . . . . . . . . . . . 22
SWD pin assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2/35
DocID023035 Rev 4
AN4080
4.3.3
4.3.4
Contents
Internal pull-up and pull-down on SWD pins . . . . . . . . . . . . . . . . . . . . . 23
SWD port connection with standard SWD connector . . . . . . . . . . . . . . 23
5
Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1
5.2
5.3
5.4
5.5
5.6
Printed circuit board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Component position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Ground and power supply (V
DD
, V
DDA
, V
DDIO2
) . . . . . . . . . . . . . . . . . . . . 24
Decoupling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Other signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Unused I/Os and features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
6
Reference design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.1
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6.1.1
6.1.2
6.1.3
6.1.4
6.1.5
6.1.6
6.1.7
Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
STM32F0x8 power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Boot mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
SWD interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Power supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Pinouts and pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.2
Component references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
7
Hardware migration from STM32F1 to STM32F0
series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
8
DocID023035 Rev 4
3/35
3
List of tables
AN4080
List of tables
Table 1.
Table 2.
Table 3.
Table 4.
Table 5.
Table 6.
Table 7.
Table 8.
Table 9.
Table 10.
Table 11.
Applicable products. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Power supplies of the STM32F0xx family. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Boot modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
SWD port pins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Mandatory components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Optional components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
STM32F1 series and STM32F03x/5x device pinout differences . . . . . . . . . . . . . . . . . . . . 32
STM32F1 series and STM32F04x device pinout differences . . . . . . . . . . . . . . . . . . . . . . . 32
STM32F1 series and STM32F07x device pinout differences . . . . . . . . . . . . . . . . . . . . . . . 32
STM32F1 series and STM32F09x device pinout differences . . . . . . . . . . . . . . . . . . . . . . . 33
Document revision history. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4/35
DocID023035 Rev 4
AN4080
List of figures
List of figures
Figure 1.
Figure 2.
Figure 3.
Figure 4.
Figure 5.
Figure 6.
Figure 7.
Figure 8.
Figure 9.
Figure 10.
Figure 11.
Figure 12.
Figure 13.
Power supply scheme of STM32F0x1/x2 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Power supply scheme of STM32F0x8 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Schottky diode connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Power on reset/power down reset waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Simplified diagram of the reset circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
PVD thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
HSE/ LSE clock sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Host-to-board connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
SWD port connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Typical layout for V
DD
/V
SS
pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
STM32F051R8 microcontroller reference schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
STM32F058R8 microcontroller reference schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
STM32F072 microcontroller reference schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
DocID023035 Rev 4
5/35
5