Install STM32CubeIDE on Linux as a Flatpak

This tutorial shows you how to install STM32CubeIDE as a Flatpak on Linux. STM32CubeIDE is an Eclipse based C/C++ integrated development environment for STM32 microcontrollers. Besides functionality for compiling, linking and debugging your STM32 firmware, STM32CubeIDE also integrates the CubeMX tool. CubeMX makes it quick and easy to configure your STM32 microcontroller. STMicroelectronics develops and maintains STM32CubeIDE and they decided to offer STM32CubeIDE to your at no cost.

Decorative image for the article about how to install STM32CubeIDE on Linux as a Flatpak.

STM32CubeIDE is truly cross-platform. You can use it on Windows 10, Linux and macOS. Personally, I find this feature the most appealing, since I prefer Linux for my development work. The ST website offers download links and installation information for Linux. What most users don’t realize is that you can also install the STM32CubeIDE as a Flatpak on your Linux system. For this reason I dedicated this article to the topic of installing STM32CubeIDE on Linux as a Flatpak.

What do you need

A Linux application packaged as a Flatpak, runs in its own isolated sandbox environment, once you installed it on your Linux system. This means that the same Flatpak offers compatibility with all Linux distributions. Kind of like a package-once-install-everywhere type solution. Refer to this article for a more in-depth tutorial on using Flatpaks. In this article we’ll install the STM32CubeIDE Flatpak on our Linux system, directly from Flathub. The Flathub on-line repository offers an ever growing collection of Flatpaks.

To complete the steps outlined in this article, all your really need is a Linux PC with graphical desktop environment. Because we intend to install STM32CubeIDE as a Flatpak, the type of Linux distribution doesn’t matter. It can be Debian, Ubuntu, Fedora, openSUSE, etc. The same goes for the type of graphical desktop environment. Feel free to use Gnome, KDE, Cinnamon, XFCE or whatever else rocks your boat. I decided on using my Linux laptop that runs Debian 10 with the Gnome desktop environment.

Install Flatpak and add the Flathub repository

Before you can install Flatpak desktop applications from the Flathub on-line repository, you first need to install the flatpak command line utility. The command to run for installing flatpak on your Linux system:

  • Ubuntu/Debian: sudo apt install flatpak
  • openSUSE: sudo zypper install flatpak
  • Fedora: already installed by default!
Terminal screenshot showing you how to install the flatpak command line utility on Debian and Ubuntu.

With the flatpak utility present on your Linux system, you can register the remote Flathub repository with it. That makes it possible to install Flatpak desktop applications, directory from the Flathub on-line repository:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Terminal screenshot that shows you how to register the remote Flathub repository, using the flatpak command line utility.

Note the information message about the XDG_DATA_DIRS in the previous screenshot. Most desktop applications that you install as a Flatpak, also install an application launcher for you in your desktop environment’s application menu. The information message basically means that you should restart your Linux system first. Otherwise these application launchers won’t work, after you installed a Flatpak. For this reason, go ahead and restart your PC. Don’t forget to bookmark this article before. That way you can continue, once your PC completed booting.

Install STM32CubeIDE from Flathub

With the Flatpak command line utility installed and configured, we can continue with the install of the STM32CubeIDE on your Linux PC. To view the command to run for installing STM32CubeIDE, you can search for STM32CubeIDE on the Flathub website. This installation command you find there:

flatpak install flathub com.st.STM32CubeIDE

Go ahead and run this command from the terminal:

Terminal screenshot that shows you how to install STM32CubeIDE on Linux as a Flatpak.

After completion of the installation, you can find the STM32CubeIDE launcher in your desktop environment’s application menu:

Screenshot of searching for the "stm32" term in the Gnome launcher. It demonstrates that the STM32CubeIDE Flatpak also installed an application launcher.

If for some reason the STM32CubeIDE launcher does not show up, do a quick logout/login and it should pop-up. Alternatively, you can start STM32CubeIDE from the terminal:

flatpak run com.st.STM32CubeIDE

Creating a new project in STM32CubeIDE

When you start STM32CubeIDE, it always first prompts you to select an Eclipse workspace. With an Eclipse workspace you manage your C/C++ projects. Furthermore, you can store your Eclipse preferences in the workspace. This makes them available to all your projects. The default location and workspace name works fine:

Screenshot that shows you how to select and create a new Eclipse workspace, after you started STM32CubeIDE.

With the workspace opened, you can continue with the creation of a new STM32 Project. From the program menu, select New → STM32 Project:

STM32CubeIDE screenshot that shows you how to create a new STM32 project.

Next, you simply follow the instructions on the new project wizard dialog to finish the creation of your project. Once done, the integrated CubeMX automatically opens up:

Screenshot that show you what STM32CubeIDE looks like after you created a new STM32 project.

Update STM32CubeIDE to the latest version

Whenever ST releases a new version of STM32CubeIDE on Flathub, you can easily update to the latest version using the command:

flatpak update com.st.STM32CubeIDE

Terminal screenshot that shows you how to update the STM32CubeIDE Flatpak, once you installed it on your Linux system.

Remove STM32CubeIDE from your Linux system

If for some reason you decided that you do not want to use STM32CubeIDE, you can remove it by running this command from the terminal:

flatpak uninstall com.st.STM32CubeIDE

For completion purposes, you can run the following command to remove any potential unused Flatpak related dependencies from your Linux system:

flatpak uninstall --unused

Wrap up

This article showed you how you can install STM32CubeIDE on your Linux system. STM32CubeIDE is an Eclipse based C/C++ integrated development environment for STM32 microcontrollers.

In case you are upgrading from Atollic TrueSTUDIO, refer to this article for tips on importing TrueSTUDIO projects into STM32CubeIDE.

Instead of following the installation instructions found on the ST website, STM32CubeIDE was installed as a Flatpak from the Flathub on-line repository.

Flatpaks offer an alternative way to install desktop application on Linux. They are especially useful in case the desktop application in question is not available for install, from your Linux distribution’s package manager.

Follow and like us:
This entry was posted in STM32 and tagged . Bookmark the permalink.