This is an old revision of the document!


Table of Contents

stlink-mini.jpg

STLink is used to program STM32 CPUs on various ARM boards via a SWD interface.

Install

mkdir -p /opt/src
cd /opt/src
git clone https://github.com/texane/stlink.git
cd /opt/src/stlink
sh autogen.sh
apt-get install libusb-1.0-0-dev
./configure --prefix=/usr/local
make
make install
cp 49-stlinkv* /etc/udev/rules.d/
cp stlink_v1.modprobe.conf /etc/modprobe.d/

Test

A simple way to test a device is to read and discard the data from it.

st-flash read /dev/null 0

Various boards have been tested in this manner below.

The vcc-gnd.

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 1024 bytes

The Maple mini clone (pictured).

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F1 Medium-density device, id 0x20036410
 INFO src/stlink-common.c: SRAM size: 0x5000 bytes (20 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes

The Nucleo STM32F302

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F3 small device, id 0x10016439
 INFO src/stlink-common.c: SRAM size: 0xa000 bytes (40 KiB), Flash: 0x10000 bytes (64 KiB) in pages of 2048 bytes

The Nucleo STM32F411

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F4 device (low power) - stm32f411re, id 0x10006431
 INFO src/stlink-common.c: SRAM size: 0x20000 bytes (128 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 16384 bytes

The STM32F4 Discovery (STM32F407VGT6)

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F4 device, id 0x10016413
 INFO src/stlink-common.c: SRAM size: 0x30000 bytes (192 KiB), Flash: 0x100000 bytes (1024 KiB) in pages of 16384 bytes

The STM32 Value Line Discovery (STM32F100RBT6B)

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F1 Medium/Low-density Value Line device, id 0x10016420
 INFO src/stlink-common.c: SRAM size: 0x2000 bytes (8 KiB), Flash: 0x20000 bytes (128 KiB) in pages of 1024 bytes

The STM32F030 DEMO BOARD V1.0

 INFO src/stlink-common.c: Loading device parameters....
 INFO src/stlink-common.c: Device connected is: F0 small device, id 0x10006444
 INFO src/stlink-common.c: SRAM size: 0x1000 bytes (4 KiB), Flash: 0x4000 bytes (16 KiB) in pages of 1024 bytes

Reference

Programming interface

For these programming interfaces two jumpers must be removed to disable the internal board connections and allow external programming.

STLink SWD VL discovery F4 discovery Nucleo CN4
1 VDD VDD VDD
2 SWCLK SWCLK SWCLK
3 GND GND GND
4 SWDIO SWDIO SWDIO
5 NRST NRST
6 SWO SWO

Target interface

STLink SWD vcc-gnd Maple mini Generic
1 VDD
2 DCLK 21 PA14
3 GND GND GND
4 DIO 22 PA13
5 NRST
6
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies