Difference between revisions of "STLink"

From PaparazziUAV
Jump to: navigation, search
(update)
(SWD Header)
Line 16: Line 16:
  
 
==SWD Header==
 
==SWD Header==
{| border="1" cellspacing="0" style="text-align:center" cellpadding="2%"
 
| align="center"  style="background:#f0f0f0;"|'''Pin\Function'''
 
| align="center"  style="background:#f0f0f0;"|'''CN2'''
 
| align="center"  style="background:#f0f0f0;"|'''Use'''
 
|-
 
| style="background:#f0f0f0;"|'''●1'''||VDD_Target||Voltage supply for target
 
|-
 
| style="background:#f0f0f0;"|'''2'''||SWDCLK||SWD clock
 
|-
 
| style="background:#f0f0f0;"|'''3'''||GND||Ground
 
|-
 
| style="background:#f0f0f0;"|'''4'''||SWDIO||SWD data input/output
 
|-
 
| style="background:#f0f0f0;"|'''5'''||NRST||reset for target
 
|-
 
| style="background:#f0f0f0;"|'''6'''||SWO||reserved
 
|}
 
  
Pin 1 is marked with a white dot.
+
[[Image:SWD_Discovery_to_Apogee.png|Pinout with Apogee connector]]
  
 
==Install Software==
 
==Install Software==

Revision as of 13:36, 10 January 2014

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

st-flash and st-util are needed Tools from texane

download and compile

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

copy the two tools into bin directory

sudo cp st-flash /usr/bin
sudo cp st-util /usr/bin

add udev rules (replace user with your username)

sudo cp /home/user/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 SWD
Set FLASH_MODE=SWD
To use stlink (requires line above)
Set STLINK=y

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