User Tools

Site Tools


Writing /var/lib/dokuwiki/data/meta/tutorials/stm32f4.meta failed
tutorials:stm32f4

This is an old revision of the document!


Table of Contents

Arm Toolchain

Before we used the summon-arm-toolchain script to make the crosscompiler tool, but now summon-arm-toolchain is not maintained anymore and now they recommend to use the official toolchain from ARM:

https://launchpad.net/gcc-arm-embedded

Also you must install the following packages:

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

To install:

  1. Set multiarch in your system.
  • To add an extra architecture (in Debian from dpkg 1.16.2 onwards) the syntaxis is as follows:
    dpkg --add-architecture <arch>
    dpkg --add-architecture i386
  • Your dpkg architectures are stored in /var/lib/dpkg/arch.
  • Now, modify /etc/apt/sources.list. Apt-sources can be architecture qualified with this syntax for each 'source':
    deb [arch=amd64,i386] http://site.example.com/debian distribution
  • Next, do apt-get update always after adding new architectures.
  1. Get the dependencies:
sudo apt-get install libncurses5:i386
  1. Download the latest installation tarball for GNU Tools for ARM Embedded Processors, and uncompress:
cd ~/local/src
wget https://launchpad.net/gcc-arm-embedded/4.9/4.9-2014-q4-major/+download/gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2
tar -xjf gcc-arm-none-eabi-4_9-2014q4-20141203-linux.tar.bz2
  1. Make the toolchain executables available to the users add the bin directory to your PATH variable:
echo 'export PATH=$PATH:/home/****user****/local/src/gcc-arm-none-eabi-4_9-2014q4/bin/' >> /home/****user****/.bashrc
  1. Remember to reload your .bashrc file, there are two ways:
  • Close your session and login again.
  • Reloading your .bashrc file directly:
. .bashrc

Project's webpage: https://github.com/texane/stlink

First we need to install the package: libusb-1.0

También se debe seguir el tutorial Using xstow for local installations antes de continuar con la instalación.

Primero ingresamos a la carpeta

cd ~/local/src/

Se descarga con git

git clone https://github.com/texane/stlink

Ingresamos a la carpeta

cd stlink
 

Configuramos

mkdir build
cd build
ccmake ..

Presione “c”. Seleccione en CMAKE_BUILD_TYPE=debug. Luego en CMAKE_INSTALL_PREFIX=/home/user/local/DIR/stlink Presione “c”, y luego “g” denuevo.

Compilamos, e instalamos

make
make install 
cd 
cd local/DIR
xstow stlink

Ahora necesitamos copiar las siguientes reglas (tenemos que estar ubicados en ~/local/src/stlink),

  
  
sudo cp 49-stlinkv1.rules /etc/udev/rules.d/
sudo cp 49-stlinkv2.rules /etc/udev/rules.d/
sudo /etc/init.d/udev restart

Libopencm3

http://www.libopencm3.org/

To build the library:

cd ~/local/src/
git clone https://github.com/libopencm3/libopencm3-examples
cd libopencm3-examples
git submodule init
git submodule update
cd libopencm3
make

Be sure to install python-yaml first.

To build an example and flash it to the f4discovery:

cd ../
cd examples/stm32/f4/stm32f4-discovery/miniblink/
make
make flash

~~DISCUSSION~~

tutorials/stm32f4.1471753443.txt.gz · Last modified: 2022/09/20 00:08 (external edit)