Difference between revisions of "STLink"
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
Libusb 1.0, autogen is required. | Libusb 1.0, autogen is required. | ||
git clone git://github.com/texane/stlink.git | git clone git://github.com/texane/stlink.git | ||
cd stlink | cd stlink | ||
Line 23: | Line 23: | ||
./configure | ./configure | ||
make | make | ||
sudo su | sudo su | ||
mkdir /opt/stlink | mkdir /opt/stlink | ||
cd /opt/stlink | cd /opt/stlink | ||
cp /home/user | cp /home/user/stlink/st-flash /opt/stlink | ||
cp /home/user | cp /home/user/stlink/st-util /opt/stlink | ||
echo PATH=\"$PATH:/opt/stlink\" >> /etc/environment | echo PATH=\"$PATH:/opt/stlink\" >> /etc/environment | ||
source /etc/environment | source /etc/environment | ||
'''FIMXE, environment variable doe not work/st-flash is not found ?''' | |||
USB permission | USB permission | ||
cp /home/user | cp /home/user/stlink/49-stlinkv*.rules /etc/udev/rules.d | ||
udevadm control --reload-rules | udevadm control --reload-rules | ||
Revision as of 13:19, 3 September 2013
SWD can be used to upload the firmware to stm32fx MCU without a bootloader.
A ST-Link is needed, any stm32-discovery board has a ST-LinkV2 on it (starts @ 8€).
A standard ST-Link costs from 17€
Needed Tools
st_flash and st_util need to be installed, compiled from source (https://github.com/texane/stlink) Libusb 1.0, autogen is required.
git clone git://github.com/texane/stlink.git cd stlink ./autogen.sh ./configure make sudo su mkdir /opt/stlink cd /opt/stlink cp /home/user/stlink/st-flash /opt/stlink cp /home/user/stlink/st-util /opt/stlink echo PATH=\"$PATH:/opt/stlink\" >> /etc/environment source /etc/environment
FIMXE, environment variable doe not work/st-flash is not found ?
USB permission
cp /home/user/stlink/49-stlinkv*.rules /etc/udev/rules.d udevadm control --reload-rules
Warning: For ST-LinkV1 take a look at the readme.txt !
Howto
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.