STM32 Development Without an IDE
Create and control your own flexible Development Environment

In this blog post, we'll showcase two methods for installing the essential tools to develop software for an STM32 target without depending on an Integrated Development Environment (IDE).


Disclaimer:
This post is primarily tailored for x86_64 Linux users. However, Windows users can also follow along using Windows Subsystem for Linux (WSL).

Development Environment vs IDE

When starting development on a new target, the typical approach is to download the vendor-specific IDE, which comes with all the necessary tools preinstalled. While this method offers a quick start, it lacks flexibility. The IDE is a fixed environment, making it challenging to modify or update integrated tools later on.

Alternatively, opting for a Development Environment (Dev Env) allows us to assemble the tools we need individually, providing greater control over the development process. Unlike an IDE, a Dev Env consists of standalone tools tailored to our requirements.

One significant advantage of using a Dev Env is the freedom to choose your preferred editor for coding. This flexibility empowers developers to work with the tools and workflows that best suit their needs.

Join our community
Tooling, development environments, best practices in embedded development platforms, and all things that empower us to create exceptional embedded systems.

DEM

We'll be utilizing DEM to create our containerized Dev Env. DEM, which stands for Development Environment Manager, facilitates the creation and management of Dev Envs based on a containerized toolset. When working without an IDE, DEM serves as the glue between individual tools, enabling their assignment to the development project seamlessly.

If you're interested in delving deeper into the advantages of containerization, you can explore our article on Maximizing efficiency.

The toolset

To establish a functional Dev Env, we'll choose the following tools:

Dev Env creation - Two ways

I. Installing on the native host


The build system

The make build system is typically available by default on most major Linux distributions, requiring no additional actions.

The toolchain

The debugger

The stlink-org is the open-source version of the STMicroelectronics STLINK Tools.

II. Simple, containerized installation

To set up a containerized Dev Env, you'll need the following tools:

Refer to the installation section of DEM’s README and follow the instructions.

Confirm the successful installation of DEM by running:

dem –version

Now, proceed with creating a Dev Env named "stm32" (or any preferred name) using the command:

dem create stm32

DEM will prompt you to select the desired tools for inclusion in the Dev Env. Choose from the available tool images:

Tool selection using DEM Selecting tool images to create the Development Environment

Finally, install the newly created Dev Env with:

dem install stm32

Containerized vs Native Dev Env


Containerized Dev Env Native Dev Env
Installation A simple dem install command. The tool container images can be used immediately. Manually, every time.
Scalability The toolset can be modified by simply adding/removing tools with DEM. Modifying the toolset involves many manual installation/uninstallation steps.
Interference The tools live in their own isolated environment. Tools can affect the behaviour of other tools and the host system.
Reproducibility Tools are guaranteed to always work the same way in every host environment. Differences in the OS and library versions between two dev PCs can result in different outputs of the same tools.

Simple reproducibility with DEM

A Dev Env can be assigned to a project with the following command:

dem assign {dev_env_name} {project_path}

This command saves the selected Development Environment descriptor to the project's root directory. Consequently, the descriptor can be added to the version control system. Employing this technique guarantees that all project contributors utilize the exact same Development Environment throughout the project's lifecycle .

Further reading

For readers interested in further exploration, we've prepared a step-by-step tutorial on creating a project for an STM32F1 target and establishing a containerized Development Environment (Dev Env). You can access the tutorial through the following link: Tutorial on STM32F1 project creation and containerized Dev Env setup.

This additional resource offers detailed guidance and insights into practical implementation, complementing the information provided in this article.

We need some cookies to make axem work. axem and our social media, advertising, analytics etc. partners would like to use additional cookies to store your preferences, gather statistics and assist with our marketing - this helps us improve axem. By clicking [Acccept all] you consent to the use of these cookies and you acknowledge that you read and understood our Cookie and Privacy Policy.

Read Privacy and Cookie Policy
Accept all Reject all