-
Notifications
You must be signed in to change notification settings - Fork 2k
ST LINK tool
Many STM-boards include an on-board ST-LINK programmer. To program the board you just need to connect a micro-USB cable to the USB port that is centered on the top of the board. To write software into the mircrocontrollers flash memory we recommend to use OpenOCD. However, some time ago we used the ST-LINK tool for this. This is a quick guide about installing and using the ST-LINK tool.
- First of all you have to download the st-flash tool from texane's github repository:
# git clone https://github.com/texane/stlink.git stlink
- Change into the new directory:
# cd stlink
- Build the st-flash tool
# ./autogen
# ./configure
# make
For this step you have to have a working build-environment installed, for debian/ubuntu you can do this by installing the build-essential
package.
- Add the
st-flash
andst-util
tools to your bin-path
Now you have to connect the device to your computer via USB-microUSB to write your program on it. Use the CN1 connector on the STM32F4discovery board for this. Normally, the device should be flashed automatically by typing:
make flash
which should run the st-flash tool. However, this did not work at my setup so I flashed the board manually using the st-flash tool:
sudo st-flash write bin/stm32f4discovery/hello-world.hex 0x8000000
(For other boards you type the respective board name). The .hex file should be written to the devices program-storage with start address 0x8000000