Difference between revisions of "STLink"
(→Install Software: edited directory for stlink tools from user folder to /opt) |
|||
Line 9: | Line 9: | ||
[http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php SWD] is a program | [http://www.arm.com/products/system-ip/debug-trace/coresight-soc-components/serial-wire-debug.php Serial Wire Debug (SWD)] is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative to JTAG | ||
Every STM discovery board comes with | Every STM discovery board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version, that board comes with ST-Link V1. | ||
==SWD Header== | ==SWD Header== | ||
Line 21: | Line 19: | ||
==Install Software== | ==Install Software== | ||
For Ubuntu/Debian. <br/> | For Ubuntu/Debian. <br/> | ||
st-flash and st-util are needed [https://github.com/texane/stlink Tools from texane] | ''st-flash'' and ''st-util'' are needed [https://github.com/texane/stlink Tools from texane] | ||
Download and compile | Download and compile | ||
cd | $ cd | ||
git clone git://github.com/texane/stlink.git stlink | $ git clone git://github.com/texane/stlink.git stlink | ||
sudo mv stlink /opt | $ sudo mv stlink /opt | ||
cd stlink | $ cd stlink | ||
./autogen.sh | $ ./autogen.sh | ||
./configure | $ ./configure | ||
make | $ make | ||
Set enviroment | Set enviroment variable | ||
exportline="PATH=$PATH:/opt/stlink" | $ exportline="PATH=$PATH:/opt/stlink" | ||
if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi | $ if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi | ||
source ~/.profile | $ source ~/.profile | ||
Add udev rules (replace user with your username) | Add udev rules (replace user with your username) | ||
sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d | $ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d | ||
sudo udevadm control --reload-rules | $ sudo udevadm control --reload-rules | ||
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt] | ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt] |
Revision as of 15:33, 25 March 2014
Serial Wire Debug (SWD) is a program and debug protocol for ARM processors. It's a low pin count and high-performance alternative to JTAG
Every STM discovery board comes with a ST-Link V2 on board, with one exception; the STM32VL version, that board comes with ST-Link V1.
SWD Header
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 variable
$ 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