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:
- 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
Expected output on an x86_64 Ubuntu system:
x86_64
amd64
4. Extract the Downloaded Package
Open the terminal and navigate to the Downloads directory.
cd ~/Downloads
Extract the ZIP archive:
unzip SetupSTM32CubeProgrammer_2.24.0_linux-x86_64.zip
After extraction, you should find the following files:
SetupSTM32CubeProgrammer-2.24.0.exe
SetupSTM32CubeProgrammer-2.24.0.linux
jre/
For Linux, we will use the .linux installer.
5. Install STM32CubeProgrammer
Make the Linux installer executable:
chmod +x SetupSTM32CubeProgrammer-2.24.0.linux
Run the installer:
sudo ./SetupSTM32CubeProgrammer-2.24.0.linux
The installer will start the installation process.
If a graphical installation wizard appears:
- Accept the license agreement.
- Keep the default installation directory.
- 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 ... ]
The default installation directory on my system is:
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/
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
Expected output:
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI
Add the executable directory to PATH:
echo 'export PATH=/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin:$PATH' >> ~/.bashrc
Reload the shell configuration:
source ~/.bashrc
7. Verify the Installation
Check whether the CLI executable is available:
which STM32_Programmer_CLI
Expected output:
/usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI
Check the installed version:
STM32_Programmer_CLI --version
My terminal output:
-------------------------------------------------------------------
STM32CubeProgrammer v2.24.0
-------------------------------------------------------------------
STM32CubeProgrammer version: 2.24.0
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
However, I received:
gtk-launch: no such application STM32CubeProgrammer
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*'
You can also inspect the desktop entry:
cat /usr/local/STMicroelectronics/STM32Cube/STM32CubeProgrammer.desktop
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)