Saturday , 19 August 2017
iten
Home » Electronics » Running STM32CubeMX on Mac OS. Finally!

Running STM32CubeMX on Mac OS. Finally!

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.

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:

After a while, the setup wizard will appear, as shown below.

Schermata 2015-09-09 alle 08.10.18

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:

After a while, STM32CubeMX will appear on the screen.

Schermata 2015-09-09 alle 07.58.56

Enjoy STM32CubeMX on your Mac 🙂


Check Also

Correct way to perform re-annotation of designators in Altium

It's really common that at the end of the board layout we have that all …

13 comments

  1. You are right, as STM32CubeMX is 100% Java code, it can run on a Mac if you explicitly call java -jar.

    That said, the validation is ongoing on Linux and Mac platforms and we have found some issues in the generated configuration files for third party IDEs.

    The generated code is correct but the third party IDE integration is not as plug and play as it is on Windows.

    Regards
    Daniel

    • Hi Daniel,
      Thank you for sharing this info 😉

      • I confirm,

        I did a similar think last May. As a matter of fact, you may also like to install it simply as an eclipse plugin, and it will work under linux/max/win without having to do any complex install. However when coming to work you will discover that there are still different path and case errors in the include instructions/files that prevent the OSX installation to run and compile smoothly on a case sensitive filesystem.

        I wrote those issues to support at ST, but as an answer I received that this type of porting is not their priority at this moment
        and they will more be focused in solving issues on the target than on the host platform.

        kind regards
        C.Alberto

  2. Hi Carmine,

    thanks for all the information you are posting!
    By the way... you once said you planned to show how to setup a bare STM32 manual toolchain (gcc + make, no IDE). Any news on this front? 🙂

  3. Almost works. I tried to set an input to pull down in the configuration tab by clicking on GPIO. This produced a dialog with the GPIO pins listed but when I clicked on the input I wanted to change, the bottom panel which is supposed to have the parameters in it, was a thin line. I could not access the popup selections. I had to run STMCube on Windows to change the input. But I"m hoping they'll fix it. I have the latest Java SDK (1.8) on Mac OS 10.9.5.

    • Carmine Noviello

      Yes, you are right. It seems that this is the only bug affecting CubeMX when running on OSX. I'm waiting for a next release: if the bug persist, I'll try to contact ST.

  4. In the past I tried patching STM32CubeMX to run on my Mac. Got close but there were too many path references that were MS Windows dependent (!). Not the kind of thing that one should do when trying to develop a multi-platform app using Java.
    I was encouraged by your posting and downloaded the new build from ST. First off, the installer window was extremely narrow and it wasn't sizable (SetupSTM32CubeMX-4.10.1-RC2.exe, latest Java release 8 update 60, OSX 10.10.5). I might have been able to complete the install, none the less, but abandoned it after reading the comments here about the tool not quite working. This is the same kind of failures I have seen before with this tool when I did get it partially working. If it doesn't work 100% then same as Strawbot mentioned, I will be forced to run it in Win7 on my VirtualBox.
    I've sent ST some feedback but I think that they don't take seriously just how many of us prefer to work on the Mac. So I'd suggest that anyone who is in that boat hit ST with that. Maybe they will allocate some resources to fixing STM32CubeMX so that it works right for us in addition to Windows users.

  5. Update: Narrow installer window issue = command line utilizes JDK, if installed, not the installed JRE version. Mine was older than rel.8,update60. Once JDK updated it worked.

    New ver. of STM32CubeMX-4.11.0 is out and it seems workable so far. I did have an issue with a Makefile generator script not handling the different '/' vs '\' OS dependent path separators but that was a minor thing (ref. web site of Makefile generator: http://www.ba0sh1.com/stm32cubemx-gcc-makefile/ ). His generator works on a Mac (uses Python) even though he doesn't mention it. When using the STM32CubeMX generated project it added some offending quotation marks to the "C_DEFS =" line (in the Makefile) but otherwise it was identical to the Makefile that resulted from the Windows generated project. Note that the Makefile generator tool (https://github.com/baoshi/CubeMX2Makefile) now wants a SW4STM32 project, not a TrueStudio one.

    So far STM32CubeMX 4.11.0 seems to be working on OSX for me other than the Makefile scripting issue. I'll update if I hit any snags. Hopefully others can make folks aware too if there are issues... and let ST know so that they hear from the Mac community otherwise they may think we don't exist.

    I hope that this helps someone. Thanks a million Carmine for all your good work. -Paul

  6. I guess most of you know this, but in case you don't: I tried out what happens when I change "STM32CubeMX.exe" to "STM32CubeMX.jar" and it seems to work, so I don't have to use the terminal window to open STM32CubeMX, just doubleclick.
    By the way, I'm quite a beginner on this field and I am trying to set up the whole toolchain (Eclipse, arm-gcc, OpenOSD) described in the 3 blog entries on my mac (OSX 10.11.1) for a student project - is this possible in principle or am I wasting my time?

    • Hi Fred,
      The procedure is almost identical on the Mac. The only relevant difference is the compiling of OpenOCD, but you'll find a README.OSX file inside it. It explains all needed steps.

      I use the Mac to develop STM32 applications without any problems.

    • Changing the exe file to jar was really helpful step 🙂 Thanks guys.

  7. thanks for your reply, that is encouraging 🙂
    and thank you for all your work here in the first place, I really appreciate the detailed instructions!

  8. Thanks for this, i was temped buying a PC just for STM32. You just saved me a 1500 USD.
    Thanks again

Leave a Reply

Your email address will not be published. Required fields are marked *