STLink

From PaparazziUAV
Revision as of 15:59, 5 March 2014 by NeoFromMatrix (talk | contribs) (→‎Install Software: edited directory for stlink tools from user folder to /opt)
Jump to navigation Jump to search
St-link.jpg


SWD is a program und debug protocoll for ARM processors.

Every STM discovery board comes with a ST-LinkV2 on board (except STM32VL comes with ST-LinkV1).

Every dicovery board from STM comes wih a ST-LinkV2, except STM32VL (ST-LinkV1).

SWD Header

Pinout with Apogee connector

Install Software

For Ubuntu/Debian.
st-flash and st-util are needed Tools from texane

Download and compile

cd
git clone git://github.com/texane/stlink.git stlink
sudo mv stlink /opt
cd stlink
./autogen.sh
./configure
make

Set enviroment variables

exportline="PATH=$PATH:/opt/stlink"
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi
source ~/.profile

Add udev rules (replace user with your username)

sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d
sudo udevadm control --reload-rules

ST-LinkV1 requires a bit different treatment, read the Readme.txt

Airframe.xml setup

Connect the ST-Link to the MCU. If a complete STM32F-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.

To use STLink via SWD
Set FLASH_MODE=STLINK

Update the ST-Link to blackmagic probe

The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.
This is irveversable !

How to upload the blackmagic probe firmware to the STLink of a discovery board