Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing STM32CubeMX on Linux

Installing STM32CubeMX on Linux

The STM32CubeMX tool is written in portable java, but unfortunately it is distributed as a Windows executable embedded in a Windows installer.

To install it on Linux:

  1. sudo java -jar SetupSTM32CubeMX-4.11.0.exe
  2. install the tool somewhere in your home, eg: /home/you/stm32/cubemx
  3. sudo chown -R you:you /home/you/stm32/cubemx

To run it:

  • java -jar /home/you/stm32/cubemx/STM32CubeMX.exe
  • or mark that file as executable, rename it to STM32CubeMX.jar, and double click it
@dmitvitalii

This comment has been minimized.

Copy link

@dmitvitalii dmitvitalii commented Jan 1, 2018

Note from future: finally CubeMX has a linux version of an installer, so launching an .exe file via java is no longer needed: you can just perform sudo ./SetupSTM32CubeMX-4.23.0.linux.

@asdmin

This comment has been minimized.

Copy link

@asdmin asdmin commented Jun 18, 2018

Yes, but the 'installer' is 32 bits, and it creates its own troubles on ia64 systems. The procedure above also can be used, when an ia64 system experiences problems with the ia32 binary.

Thanks for the procedure!

@maxmbed

This comment has been minimized.

Copy link

@maxmbed maxmbed commented Sep 30, 2018

Thanks java command is still useful. I did not want to install 32 bits lib.

@gooyle

This comment has been minimized.

Copy link

@gooyle gooyle commented Oct 28, 2018

Thanks java command is still useful. I did not want to install 32 bits lib.

I am using the ubuntu 18.04,but it shows ''no jave commond",is there any solutions?

@VictorTagayun

This comment has been minimized.

Copy link

@VictorTagayun VictorTagayun commented Feb 2, 2019

Hello I am using Ubuntu 18.04, how to make shortcut for it?

@vpatron

This comment has been minimized.

Copy link

@vpatron vpatron commented Mar 3, 2019

Thanks for the instructions! I'm using GalliumOS (based on Xubuntu) on my Chromebook and I'm finding that I need to use jdk 8 instead of 9, else I get an error running it:

sudo apt install openjdk-8-jre

then do the java commands like in your instructions. The sudo ./SetupSTM32CubeMX-4.23.0.linux someone mentioned above doesn't work for me.

@K1ngjulien

This comment has been minimized.

Copy link

@K1ngjulien K1ngjulien commented Mar 25, 2019

@VictorTagayun
Save the following code in ~/.local/share/applications/stm32cubemx.desktop:

[Desktop Entry]
Name=STM32CubeMX
GenericName=STM32CubeMX
Comment=Graphical tool for configuration of STM32 Microcontrollers
Exec=/usr/local/STMicroelectronics/STM32Cube/STM32CubeMX/STM32CubeMX
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/home/<USERNAME>/.local/share/applications/icons/stm32cubemx.png
StartupWMClass=STM32CubeMX
StartupNotify=true

And don't forget the icon in ~/.local/share/applications/icons/stm32cubemx.png or change the paths in the .desktop-file accordingly.
stm32cubemx

Hope this helps :)

@symdeb

This comment has been minimized.

Copy link

@symdeb symdeb commented Sep 14, 2019

Above solutions don't work for CubeProg (Ubuntu 19.04 Linux x64)

sudo ./SetupSTM32CubeProgrammer-2.1.0.linux
Error: Unable to access jarfile SetupSTM32CubeProgrammer-2.1.0.exe

Sudo java -jar SetupSTM32CubeProgrammer-2.1.0.linux
Error: Invalid or corrupt jarfile SetupSTM32CubeProgrammer-2.1.0.linux

@simonsunnyboy

This comment has been minimized.

Copy link

@simonsunnyboy simonsunnyboy commented Dec 3, 2019

Above solutions don't work for CubeProg (Ubuntu 19.04 Linux x64)

sudo ./SetupSTM32CubeProgrammer-2.1.0.linux
Error: Unable to access jarfile SetupSTM32CubeProgrammer-2.1.0.exe

Sudo java -jar SetupSTM32CubeProgrammer-2.1.0.linux
Error: Invalid or corrupt jarfile SetupSTM32CubeProgrammer-2.1.0.linux

Use the windows .exe instead. The .linux file is only for old 32bit architectures and does not run anymore on AMD64 systems (if i understood correctly)

It worked fine for me on Ubuntu 18.04 here. I renamed the .exe to .jar to make sure.

@Lanchon

This comment has been minimized.

Copy link
Owner Author

@Lanchon Lanchon commented Dec 3, 2019

@VictorTagayun,

this solution provided to your is perfect: https://gist.github.com/Lanchon/2156953d18f7534a926b#gistcomment-2871284

however, there are quite a few GUI menu editors you can easily install from the ubuntu repos, such as MenuLibre. try them!

@vincentl-dev

This comment has been minimized.

Copy link

@vincentl-dev vincentl-dev commented Apr 17, 2020

Hello and thanks to all. I could follow simonsunnyboy & kingjulien advices and install on Ubuntu 19.10 latest version of CubeMX (5.6.1)
Everythings works ok (Design & code generation) , However update from the CubeMX make the tool freeze, I have to reboot the machine.
Since I run Linux from VirtualOrg, it could be virtual machine settings not cubeMX tool. Can anybody with a real linux machine has update working fine ? (Please note all my internet browser, mails are working fine in my Ubuntu virtual machine).
Thanks a lot !

@simonsunnyboy

This comment has been minimized.

Copy link

@simonsunnyboy simonsunnyboy commented Apr 17, 2020

Hello and thanks to all. I could follow simonsunnyboy & kingjulien advices and install on Ubuntu 19.10 latest version of CubeMX (5.6.1)
Everythings works ok (Design & code generation) , However update from the CubeMX make the tool freeze, I have to reboot the machine.
Since I run Linux from VirtualOrg, it could be virtual machine settings not cubeMX tool. Can anybody with a real linux machine has update working fine ? (Please note all my internet browser, mails are working fine in my Ubuntu virtual machine).
Thanks a lot !

I just tried the update here on a real linux machine. It installed an update of the Cube to V5.6.1 without issues.
Priviliges can be of concern.

I made sure to install the CubeMx here with my user priviliges on a folder with my user acces rights.
A popup with adminstrator restart came up but I safely ignored that one. No need no login or sudo, I just restarted the CubeMX GUI as my regular user and it worked for me.

Addendum I also did not a sudo install of the original package IIRC.

@vincentl-dev

This comment has been minimized.

Copy link

@vincentl-dev vincentl-dev commented Apr 17, 2020

thanks simonsunnyboy. Since you shared STM32CubeMX's update were working fine on a "real" linux, I 've tried a bit to play around with VirtualBox's setting. Then i've seen in readme of the tool that it was a java 32 bits software. So i've installed 32 bits version of JRE
sudo apt-get install default-jre:i386
and "Voila !" STM32CubeMX update were suddently working.
The STM32CubeMx however trigs me a message telling it is not happy to have 32 bits JRE installed in 64 bits Linux.
sudo apt-get install default-jre
allow me to get rig of it...
So in the end I guess STM32CubeMX is finding what it need for the java...I must have some bits of jre 32 bits and 64 bits in my system...
I am definitly not llinux expert so sorry guys cannot really explain why it is working but only what I did to have it work !
good night !

@photon-delight

This comment has been minimized.

Copy link

@photon-delight photon-delight commented Jun 2, 2020

Above solutions don't work for CubeProg (Ubuntu 19.04 Linux x64)

sudo ./SetupSTM32CubeProgrammer-2.1.0.linux
Error: Unable to access jarfile SetupSTM32CubeProgrammer-2.1.0.exe

Sudo java -jar SetupSTM32CubeProgrammer-2.1.0.linux
Error: Invalid or corrupt jarfile SetupSTM32CubeProgrammer-2.1.0.linux

One needs to extract both the .linux and .exe files. My mistake was that I assumed that only the .linux was necessary to extract. Once both of these files have been extracted, ./SetupSTM32CubeProgrammer-2.4.0.linux works as it should

@mianqi2016

This comment has been minimized.

Copy link

@mianqi2016 mianqi2016 commented Feb 27, 2021

I have downloaded STM32CubeMX for Linux, and extracted it on Ubuntu 20.04, and double-click the setup file, no error prompted, but I couldn't launch it, how to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment