Difference between revisions of "STLink"
Line 9: | Line 9: | ||
Every STM discovery / eval 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 comes with a ST-Link V1. | |||
Every STM discovery / eval 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 | |||
==SWD Header== | ==SWD Header== |
Revision as of 13:33, 30 March 2015
Every STM discovery / eval board comes with a ST-Link V2 on board, with one exception; the STM32VL version comes with a ST-Link V1.
SWD Header
Install Software
The st-flash and st-util tools are needed, provied by texane
Download and compile
$ cd /opt $ git clone git://github.com/texane/stlink.git stlink $ 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
$ 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 STM32Fx-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 via STLink as default:
Set FLASH_MODE=STLINK
Update the ST-Link to blackmagic probe
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firware.
Black Magic Discovery from Esden <-- This also describes how to remove the read out protection.
embdev.net page