This first post of the STM32 tutorial will help you to set up your programming environment for programming STM32 Microcontrollers. There are many different IDEs available for the purpose of programming and debugging of STM32 controllers. When I look back it was not easy to determine which IDE to use. You can find a comparison at this link. Most of the tools available are commercially but also offer limited free versions. Mostly there is a code size limit which is very annoying in my point of view. Of course they will be preferred from companies because of the support and so on. Im my opinion the work of people who publish open source projects should be honored and so I chose to use the SW4STM32 software or also called OpenSTM32 and SystemWorkbench.
Installation of SW4STM32
This software package is based on Eclipse which is a very popular software for developing many different kinds of code. Furthermore it includes the CubeMX plugin which enables automated code generation. Additionally it offers the possibility of debugging the target directly in the IDE. You can find the software on the webpage www.openstm32.org. When the site is opened, please click on “System Workbench for STM32 – Bare Metal Edition”. I marked it in the picture below. To access the next couple of sites it is necessary to register first. Just a quick note here, I never got any spam mail because of the registration.
There are two different options for installing the software. The first option shows how to install the plugins directly on an already installed Eclipse software. The second option leads to a completely new install of Eclipse with all necessary plugins. I am recommending the second option because it is more reasonable for me. This is because I am programming different kinds of programming languages and I like to split them up in different programs. Furthermore, I can leave the actual workspace fixed for a specific sort of programming language and do not need to switch between them. Of course you can do whatever you prefer, the usage in the end will be the same.
On the next site you have to click on “Downloading the System Workbench for STM32 installer” and after this step please choose your operating system for downloading the installer. When the download has finished please install the software.
Setting up working environment
First you need to select your workspace. I tend to create a new folder for every platform because it is very convenient and keeps some order. In this case I named the folder STM32. The workspace is the folder where all the projects that you create in SW4STM32 are saved.
The welcome screen displays some options which are self explanatory. We do not need any of them so please click on “Workbench” in the top right corner. Now you can see your work screen.
Next we want to create a new perspective for convenient access of the STM32CubeMX plugin. Please click on the symbol with the plus sign left to the C/C++ symbol. Now select the STM32CubeMX plugin to add it to your perspectives.
Now you can see the STM32CubeMX plugin which we will observe in detail later.
Next we will also add a perspective for debugging. Again please click on the symbol with the plus sign in the top right corner and select “Debug”.
Now we have installed and setup our working environment for starting to program our first program.
You might ask which hardware I am going to use for this tutorial series. This and also a short introduction of setting up a basic project will be discussed in the next part of this tutorial series.