October 12, 2026

First experiences with STM32 CubeMX -- CubeMX on linux

We installed CubMX on my Mac Mini, now lets see about installing it on my linux system. There is now CubeMX and CubeMX2. As near as I can tell, CubeMX2 only supports the new STM32C5 microcontrollers. The STM32C5 controllers aim to be low price, use a Cortex-M33 core, and typically have 512K of flash and 128K of ram. The cpu runs at 144 Mhz.

CubeMX2 does not even support my STM32H7 parts, so, we will install good old CubeMX.

I select the "Generic Linux" download. It will give me version 6.18.1 as of 10-12-2026. I login using my ST credentials and away we go. It takes a while. I get a 632M zip file.
mv SetupSTM32CubeMX-6.18.1-Lin-x86_64.zip /Projects/STM32/Cube
cd /Projects/STM32/Cube
mkdir Cube-6.18.1
cd Cube-6.18.1
unzip ../SetupSTM32CubeMX-6.18.1-Lin-x86_64.zip
This yields a "jre" directory and SetupSTM32CubeMX-6.18_1 which is an executable. There is also Readme.html, which I can view using "w3m Readme.html".
I run the executable. -- I wants to install to /home/tom/STM32CubeMX. I change this to /Projects/STM32/STM32CubeMX. The install is very fast. It tells me there is an uninstaller:
/Projects/STM32/STM32CubeMX/Uninstaller
I explore the XFCE startup menus (which I rarely use) and find STM32CubeMX under "Other" (and the only thing there). Using this starts it nicely.

I drag the "MX" icon from the XFCE startup menu to my desktop dock, which will make it easy to start up as needed.

A first project

I have been using it on the Mac with my F743 board, so let's try that here.

I use the board selector, and it needs to download stuff from the network.
I type "Nucleo" into the Commercial product field and find Nucleo-H743-ZI2 fairly quickly in the reduced list that yields. Now I select "Generate demo code" in the "Board Project Options" popup I get and click OK.
Now I see the big image of the chip.

I go to the Project Manager tab, name the project "Demo".
I select "Makefile" as my toolchain.
I change Project Location to /Projects/STM32/Cube/Projects
I click "Generate Code" at the extreme upper right.

It wants to download STM32CubeFW_H7 V1.13.0 -- and I say Yes.

This is big (584M), but it downloads pretty fast.

When this finishes, it tells me my code has been generated.

I do indeed find the code in /Projects/STM32/Cube/Projects/Demo
I type "make" -- and it builds clean, giving me Demo.elf.

I copy my "flash" script from the Mac system:

#!/usr/bin/env python3

import os
import sys

file = sys.argv[1]

cmd = f"openocd -f interface/stlink.cfg -f target/stm32h7x.cfg -c \"program {file} verify reset exit\""
print ( cmd )
os.system ( cmd )

Finally I type "flash build/Demo.elf" and it downloads my code to the board.
It runs. I can press the blue user button and turn the user LED on and off.

I can also see a bit of output from the serial port if I use picocom:

picocom -b115200 /dev/ttyACM0
When I press the black reset button, I see:
Welcome to STM32 world !
This is produced by a printf statement in main.c and apparently is the "virtual serial port" mentioned in the "Board Project Options" popup when we first began the project.

Migrate a project

I have a project called "Net1" on my Mac system. I use tar to capture the entire Net1 directory. Then I extract it into a Net1 directory on my linux system. I type "make clean; make" and everything works fine.

CubeMX doesn't discover this when I restart. I use "Other Projects" to navigate to it. What it wants is the .ioc file. Once I point it to this, it finds the project and adds it to the recently opened projects list. I check various things and it all looks like the work I did on the Mac system.

Conclusions

This was fairly quick and without surprises. Of course I have been through all of this on my Mac system, so I knew what to expect on Linux. Abandon all hope on Windows.

It is also nice that it is simple and easy to move a project from the Mac to Linux, and no doubt it will go easily in the other direction if needed.


Have any comments? Questions? Drop me a line!

Tom's software pages / tom@mmto.org