• Install ARM-CGG Cross Compiler

     

         Open a terminal and execute the following command to install g++:

mkdir -p ${HOME}/stm
cd ${HOME}/stm
mkdir arm-gcc && cd arm-gcc wget http://diy.ind.in/stm/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 tar -xvjf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
chmod -R -w ${HOME}/stm/arm-gcc/gcc-arm-none-eabi-7-2018-q2-update 

get latest ARM-GCC compiler from here

  • Install St-Link

     

         Open a terminal and execute the following command to install St-Link:

sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libgtk-3-dev

mkdir -p ${HOME}/stm/stlink cd ${HOME}/stm/stlink
wget http://diy.ind.in/stm/stlink-master.zip unzip stlink-master.zip cd stlink-master
make
cd build/Release
sudo cp st-flash /usr/bin
sudo make install


  • Check with blink program

     

         Open a terminal and execute the following command to test blink program:

mkdir -p ${HOME}/stm/stm_pro
cd ${HOME}/stm/stm_pro wget http://diy.ind.in/stm/stm32f103-blink.zip unzip stm32f103-blink.zip
cd stm32f103-blink
st-info --descr
st-flash erase
st-flash write Blink.bin 0x8000000
  • Install Standered Peripheral Library

     

         Open a terminal and execute the following command to install Standard Peripheral Libraries :

mkdir -p ${HOME}/stm/st_sp_lib
cd ${HOME}/stm/st_sp_lib wget http://diy.ind.in/stm/en.stsw-stm32054.zip unzip en.stsw-stm32054.zip

     

         Open a terminal and execute the following command to check blink Program:

mkdir -p ${HOME}/stm/stm32f103_template
cd ${HOME}/stm/stm32f103_template wget http://diy.ind.in/stm/stm32f103-template.zip unzip stm32f103-template.zip
cd stm32f103-template
make clean
make
make burn
  • GDB Debuger

     

         Start GDB Server:

cd ${HOME}/stm/stm_pro/stm32f103-blink
st-util

         Connect to Debuger

cd ${HOME}/stm/stm_pro/stm32f103-blink
arm-none-eabi-gdb Blink.elf

         Load file and run:

tar extended-remote :4242
load Blink.elf
run

  • Cube MX

     

         Open a terminal and execute the following command to install 32 bit compatibility:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
sudo apt-get install openjdk-8-jdk

     

         Open a terminal and execute the following command to install Cube MX:

mkdir -p ${HOME}/stm/cube
cd ${HOME}/stm/cube
mkdir cube_mx cube_code cube_setup && cd cube_setup wget http://diy.ind.in/stm/en.stm32cubemx.zip
unzip en.stm32cubemx.zip
cd en.stm32cubemx
./SetupSTM32CubeMX-5.0.1.linux

     

         Open a terminal and execute the following command to download cube support for stm32f103:

mkdir -p ${HOME}/STM32Cube
cd ${HOME}/STM32Cube
mkdir Repository && cd Repository wget http://diy.ind.in/stm/en.stm32cubef1.zip
unzip en.stm32cubef1.zip