October 2018 UM0892 Rev 24 1/54
UM0892
User manual
STM32 ST-LINK utility software description
Introduction
The STM32 ST-LINK utility software facilitates fast in-system programming of the STM32
microcontrollers during development via the ST-LINK, ST-LINK/V2 and ST-LINK-V3 tools.
This user manual describes the software functions of the STM32 ST-LINK utility.
When working with the STM32 ST-LINK utility, it is recommended to download the user
manuals ST-LINK in-circuit debugger/programmer for STM8 and STM32 microcontrollers
(UM0627) and ST-LINK/V2 in-circuit debugger/programmer for STM8 and STM32
(UM1075), which provide more information about the ST-LINK tools.
Note: The part number of the STM32 ST-LINK utility software is STSW-LINK004.
www.st.com
Contents UM0892
2/54 UM0892 Rev 24
Contents
1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Hardware requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Installing the STM32 ST-LINK utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Uninstalling the STM32 ST-LINK utility . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 STM32 ST-LINK utility user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 Main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2 Menu bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.1 File menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2.2 Edit menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 View menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.4 Target menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.5 ST-LINK menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.6 External Loader menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2.7 Help menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3 STM32 ST-LINK utility features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 Device information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Memory display and modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 Flash memory erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.5 Device programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.6 Option bytes configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.7 MCU core functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.8 Automatic mode functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.9 Developing customized loaders for external memory . . . . . . . . . . . . . . . 31
3.9.1 Loader_Src.c file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.9.2 Dev_Inf.c file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.10 Printf via SWO viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4 STM32 ST-LINK utility command line interface (CLI) . . . . . . . . . . . . . . 35
4.1 Command line usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35