DEV Community

Cover image for How to Install STM32CubeProgrammer on Linux (Ubuntu)
ABDUL SATTAR
ABDUL SATTAR

Posted on

How to Install STM32CubeProgrammer on Linux (Ubuntu)

How to Install STM32CubeProgrammer on Linux (Ubuntu) – Step-by-Step Guide

Introduction

STM32CubeProgrammer is a tool from STMicroelectronics used to program STM32 microcontrollers. It supports programming, erasing, verifying and configuring STM32 devices through interfaces such as ST-LINK, UART and USB DFU.

In this tutorial, we will install STM32CubeProgrammer v2.24.0 on Ubuntu Linux and verify the installation using its Command-Line Interface (CLI).

1. Create an STMicroelectronics Account

First, visit the official STMicroelectronics website:

https://www.st.com/

  • Log in to your STMicroelectronics account.
  • If you don't have an account, create one.
  • Complete the registration and sign in.

2. Navigate to STM32CubeProgrammer

Follow this navigation path on the STMicroelectronics website:

Development Tools → Software Development Tools → STM32 Software Development Tools → STM32 Programmers → STM32CubeProgrammer

Official download page:

https://www.st.com/en/development-tools/stm32cubeprog.html

3. Select the Correct Linux Package

Select the STM32CubeProgrammer version and download the package according to your system architecture.

System architecture Package to download
ARM 64-bit (AArch64) Linux ARM64
Intel / AMD 64-bit (x86_64) Generic Linux / Linux x86_64

Important: Select the correct architecture before downloading.

For example, my development laptop uses an AMD64 architecture, so I downloaded:

SetupSTM32CubeProgrammer_2.24.0_linux-x86_64.zip

You can verify your Linux architecture using:

uname -m
dpkg --print-architecture
Enter fullscreen mode Exit fullscreen mode

Expected output on an x86_64 Ubuntu system:

x86_64
amd64
Enter fullscreen mode Exit fullscreen mode

4. Extract the Downloaded Package

Open the terminal and navigate to the Downloads directory.

cd ~/Downloads
Enter fullscreen mode Exit fullscreen mode

Extract the ZIP archive:

unzip SetupSTM32CubeProgrammer_2.24.0_linux-x86_64.zip
Enter fullscreen mode Exit fullscreen mode

After extraction, you should find the following files:

SetupSTM32CubeProgrammer-2.24.0.exe
SetupSTM32CubeProgrammer-2.24.0.linux
jre/
Enter fullscreen mode Exit fullscreen mode

For Linux, we will use the .linux installer.

5. Install STM32CubeProgrammer

Make the Linux installer executable:

chmod +x SetupSTM32CubeProgrammer-2.24.0.linux
Enter fullscreen mode Exit fullscreen mode

Run the installer:

sudo ./SetupSTM32CubeProgrammer-2.24.0.linux
Enter fullscreen mode Exit fullscreen mode

The installer will start the installation process.

If a graphical installation wizard appears:

  1. Accept the license agreement.
  2. Keep the default installation directory.
  3. Complete the installation.

My installation terminal output:

Installation started
Framework: 1.8.0_202-b08 (Oracle Corporation)
Platform: ubuntu_linux,version=7.0.0-43-generic,arch=x64
Installation finished
[ Writing the uninstaller data ... ]
Enter fullscreen mode Exit fullscreen mode

The default installation directory on my system is:

/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/
Enter fullscreen mode Exit fullscreen mode

6. Configure the Environment PATH

After installation, we need to configure the PATH environment variable so that STM32CubeProgrammer CLI commands can be executed from any terminal directory.

First, locate the CLI executable:

find /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer \
    -name STM32_Programmer_CLI -type f
Enter fullscreen mode Exit fullscreen mode

Expected output:

/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI
Enter fullscreen mode Exit fullscreen mode

Add the executable directory to PATH:

echo 'export PATH=/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin:$PATH' >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

Reload the shell configuration:

source ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

7. Verify the Installation

Check whether the CLI executable is available:

which STM32_Programmer_CLI
Enter fullscreen mode Exit fullscreen mode

Expected output:

/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI
Enter fullscreen mode Exit fullscreen mode

Check the installed version:

STM32_Programmer_CLI --version
Enter fullscreen mode Exit fullscreen mode

My terminal output:

-------------------------------------------------------------------
                  STM32CubeProgrammer v2.24.0
-------------------------------------------------------------------

STM32CubeProgrammer version: 2.24.0
Enter fullscreen mode Exit fullscreen mode

If you get the version information, the CLI installation is successful!

8. Troubleshooting: GUI Application Not Launching

While testing the installation, I tried launching the GUI using:

gtk-launch STM32CubeProgrammer
Enter fullscreen mode Exit fullscreen mode

However, I received:

gtk-launch: no such application STM32CubeProgrammer
Enter fullscreen mode Exit fullscreen mode

This does not necessarily mean the installation failed. gtk-launch requires a matching desktop application ID.

To investigate, locate the GUI executable and desktop launcher:

find /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer \
    -type f -iname '*STM32CubeProgrammer*'
Enter fullscreen mode Exit fullscreen mode

You can also inspect the desktop entry:

cat /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer.desktop
Enter fullscreen mode Exit fullscreen mode

Use the actual GUI executable or desktop entry to launch the application.

Note: The CLI was successfully installed and verified on my Ubuntu system. GUI launch still needs separate verification.

Conclusion

STM32CubeProgrammer v2.24.0 is now installed on my Ubuntu x86_64 development machine, and its CLI is working correctly.

This is the first step towards setting up an STM32 development environment.

My next objective is to connect the STM32N6570-DK Discovery Kit, establish communication through the onboard ST-LINK debugger and start exploring the board.

Useful Links


Tested on Ubuntu Linux | STM32CubeProgrammer v2.24.0 | x86_64 architecture

Top comments (0)