Building the JTAG comunication tool STLINK

STLINK is open source software to program and debug ST’s STM32 Discovery kits. Those kits have an onboard chip that translates USB commands sent by the host PC into JTAG/SWD commands.

sudo apt-get install libusb-1.0-0-dev

This is the previously created directory for building purposes

 cd  ~/stm32build
git clone git:// stlink_texane
cd stm32build/stlink_texane/



If everything went ok we will binaries of st-flash and st-util





add the binaries to .bashrc using export command

connect the board to the theJtag communication part we can see power and one another led islighted up in red color…open up a terminal and issue the command


It detects the hardware and listens to the port and we can see the jtag led turns green when board is detected


Getting started with STM32F4Discovery in Gnu/Linux


Building Toolchain

To compile code for STM32F4Discovery we need to setup ARM Toolchain in our system whichsupport ARM Cortex M3.I used summon ARM toolchain which is available in github

First install the dependencies in our system

sudo apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev 
libmpc-dev autoconf texinfo build-essential libftdi-dev

We should also do this too

sudo apt-get build-dep gcc-4.5

Make a directory somewhere to do the whole build process i made a folder named stm32build in home directory

mkdir  ~/stm32build
cd  ~/stm32build

clone the summon-arm- toolchain

git clone
cd summon-arm-toolchain

read the README  befor begining the build

$./summon-arm-toolchain LIBSTM32_EN=1

While building the toolchain i got an error on gdb like this


to fix this error i edited the summon-arm-toolchain file







I changed the GDB names from the default code and restarted the build and it worked fine.After final installation the output was like this










When the installation is completed afolder named sat will be created in your system insidethat folder there will bea bin folder where all the binaries will be located





export all these binaries to your $PATH so that we can acess it everywhere.

export PATH=~/sat/bin:$PATH

Add this to the end of your .bashrc file

So the toolchain is ready now…. 🙂