Skip to content

Matiasus/stm32f103c8t6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Start with stm32 in Ubuntu 20.04

Dependencies / Softwer

  • Install libusb - userspace USB programming library development files
  • Install stlink - open source toolset to program and debug STM32 devices and boards
  • Install GNU Arm Embedded Toolchain - is a ready-to-use, open-source suite of tools for C, C++ and assembly programming
  • STM32-Template - according to Geoffrey Brown stm32 template
  • Standard Periheral Library - the Library includes a complete register address mapping with all bits, bitfields and registers declared in C a collection of routines and data structures covering all peripheral functions (drivers with common API)

Install libusb

ubuntu@ubuntu:~$ sudo apt-get install libusb-1.0-0-dev

Install stlink

There are two possible ways described how to install stlink, e.g.:

Install .deb package

Download and install .deb package using Software Center. Another possible way to install stlink is described in section below.

Install from source

Install stlink into folder /opt

ubuntu@ubuntu:~$ cd /opt
ubuntu@ubuntu:~$ git clone https://github.com/texane/stlink.git
ubuntu@ubuntu:~$ cd stlink
ubuntu@ubuntu:~$ make clean
ubuntu@ubuntu:~$ make release
ubuntu@ubuntu:~$ make install

Install / Copy stlink rules

// install udev rules
ubuntu@ubuntu:~$ sudo cp etc/udev/rules.d/49-stlinkv* /etc/udev/rules.d/
// restart sudo restart udev
ubuntu@ubuntu:~$ sudo udevadm control --reload
// using this command no need to disconnect and connect device
ubuntu@ubuntu:~$ sudo udevadm trigger

Troubleshooting

// error message
st-info: error while loading shared libraries: libstlink.so.1:
cannot open shared object file: No such file or directory.
// solving
ubuntu@ubuntu:~$ sudo ldconfig

The GNU Arm Embedded toolchain contains integrated and validated packages featuring the GCC compiler, libraries, and other tools necessary for bare-metal software development.

Download and extract GNU Toolchain. Then copy extracted files into folder /opt/gcc-arm:

ubuntu@ubuntu:~$ sudo cp -a /home/<your name of home directory>/Downloads/<Extracted GNU Toolchain package>  /opt/gcc-arm

Structure of folder /opt/gcc-arm should look like:

  • arm-none-eabi
  • bin
  • lib
  • share

Create symbolic links

ubuntu@ubuntu:~$ sudo ln -s /opt/gcc-arm/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc
ubuntu@ubuntu:~$ sudo ln -s /opt/gcc-arm/bin/arm-none-eabi-ar /usr/bin/arm-none-eabi-ar
ubuntu@ubuntu:~$ sudo ln -s /opt/gcc-arm/bin/arm-none-eabi-as /usr/bin/arm-none-eabi-as
ubuntu@ubuntu:~$ sudo ln -s /opt/gcc-arm/bin/arm-none-eabi-objcopy /usr/bin/arm-none-eabi-objcopy
ubuntu@ubuntu:~$ sudo ln -s /opt/gcc-arm/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size

Trobleshooting

// error message
arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: 
cannot open shared object file: No such file or directory
// solve
ubuntu@ubuntu:~$ sudo apt-get install libncurses5

Links

About

stm32f103 - Toolchains for Ubuntu

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published