/STM32-base

A simple start for any STM32 based project.

Primary LanguageAssemblyGNU General Public License v3.0GPL-3.0

STM32-base project

Welcome to the STM32-base project main repository! The purpose of the STM32-base project is to provide a simple and easy to understand starting point for programming STM32 microcontrollers. See the STM32-base project Github pages for more information on this project and how to get started.

WARNING: This project is work in progress! Anything can (and probably will) change! Do not use the code found in this project for any critical system(s). The use of the code and documentation is at your own risk!

Getting started

If you want to get started with the STM32-base project, start by reading the setup guide! For a more brief guide, refer to the quick start below.

Quick start

  1. Create a workspace folder
    Create a folder named STM32-base. Then, create three sub-folders: libraries, projects, templates, tools
  2. Install required software
    Install Git, make (part of build essentials on Debian/Ubuntu), the GNU ARM Embedded Toolchain (put these in the tools folder you just created), and the open-source ST-Link.
  3. Clone this repository
    Clone this repository in the STM32-base folder using Git: git clone git@github.com:STM32-base/STM32-base.git
  4. Clone a template repository
    Clone one, some or all the template repositories using Git:
    git clone git@github.com:STM32-base/STM32-base-F0-template.git
    git clone git@github.com:STM32-base/STM32-base-F1-template.git
    git clone git@github.com:STM32-base/STM32-base-F2-template.git
    git clone git@github.com:STM32-base/STM32-base-F3-template.git
    git clone git@github.com:STM32-base/STM32-base-F4-template.git
    git clone git@github.com:STM32-base/STM32-base-F7-template.git
  5. Test your setup
    Move into one of the template folders. Create a symbolic link to the STM32-base project folder: ln -s ../../STM32-base and to the STM32-base-STM32Cube folder: ln -s ../../STM32-base-STM32Cube. Then run make. If compilation completes without errors you have successfully installed the STM32-base project.

Boards

If you are looking for an overview of the many different available STM32 development boards, take a look at the Boards page.

Contributing

If you want to contribute to this project, please see CONTRIBUTING.md for more information on contributing to this project.

About this project & me

The purpose of this project is to provide a simple and easy to understand base project for programming STM32 microcontrollers using an open-source toolchain. Most other projects and tutorials assume the make files, linker scripts, startup code, and CMSIS are already there and consider them as black boxes. Because of that, most of these projects and tutorials do not include any explanation on what these files are, what these files do, and how the toolchain works.

That was the main reason I started this project, as I do want to understand how the toolchain works. As I had no prior experience with bare-metal programming (ARM) microcontrollers I took a deep dive into the world of programming ARM-based microcontrollers. As I was learning about the ARM toolchain and STM32 devices I needed some place to document my findings. This project is the result of me documenting the things I learnt along the way. And still, this project only scratches the surface of programming ARM microcontrollers. There is much, much more to learn and discover. So if you are interested in programming STM32 microcontrollers, keep an eye on this project!

I hope this project is helpful to those who are interested in programming STM32 microcontrollers and to those who want to know more about the open-source ARM toolchain and STM32 microcontrollers. To learn more about the things I do, visit my website at thomas-gravekamp.nl. I am in no way affiliated with STMicroelectronics.

- Thomas Gravekamp