[box type="warning" align="" class="" width=""]Read carefully
This post is outdated, since the latest CubeMX 4.14 officially supports both Linux and MacOS. So, you no longer need to apply the instructions reported here.[/box]
Being a STM32 programmer on Mac OSX, I was frustrated every time I had to launch a virtual machine running Windows only to use the STM32CubeMX tool from ST. For those of you new to this program, it's a really useful graphical tool that allows to automatically generate setup files for a STM32 MCU according the configuration we need. For example, if we have the Nucleo-F401RE, which is based on the STM32F401RE MCU, and we want to use its user LED (marked as LD2 on the board), than STM32CubeMX will automatically generate all files required to configure the MCU (clock, peripherals port, and so on) and the GPIO connected to LED (port GPIO 5 on port A on Nucleo boards).
Finally, this morning, I discovered accidentally that the latest version of STM32CubeMX tool (4.10) works perfectly on Mac, even if ST hasn't released it yet. I had tested this procedure in the past with previous release of the tool, but there were issues with the graphical MCU render. Now all seems works correctly.
So, to use STM32CubeMX on your Mac (I think that instructions works well even on Linux), ensure that you have the latest Java (release 8 update 60) installed. Then download the tool from ST website. The file is a ZIP archive. Once extracted, you'll find a file named SetupSTM32CubeMX-4.10.0.exe. This file is not a Windows PE file (the file format used by Windows executables), but it's just a JAR archive! And it's the installer that will install the tool on our Mac.
The installer need root privileges to work correctly. So, using the Terminal program, you can execute it using this command:
$ sudo java -jar ~/Downloads/SetupSTM32CubeMX-4.10.0.exe
After a while, the setup wizard will appear, as shown below.
Follow the setup instructions. By default, the program is installed in /Applications/STMicroelectronics/STM32Cube/STM32CubeMX. Once setup is completed, at terminal line write this command:
$ java -jar /Applications/STMicroelectronics/STM32Cube/STM32CubeMX/STM32CubeMX.ex
After a while, STM32CubeMX will appear on the screen.
Enjoy STM32CubeMX on your Mac 🙂
19 comments