# Toolchains for STM32CubeMX IDE: what to choose from?

I just installed the STM32CubeMX (original ST Microelectronics's ARM IDE if I understand right). Once installed I tried to open a new project for a DISCOVERY kit I have (STM32F0DISCOVERY).

Howether after I proceed to Open project I faced with a demand to install a toolchain:

As I revealed EWARM is a full functional IDE by IAR so I was surprised that STM's IDE requires IAR's IDE for its work (besides IAR's EWARM isn't a freeware - it is a very expensive software as I know).

In the project settings window are three choices:

• IAR's EWARM,

• Keil's MDK-ARM and

• Atollic's TrueSTUDIO.

All are very pricey :(

So the questions are:

1. Is it correct that STM's STM32CubeMX will not gives me any functionality for free?

2. As I understand from the message, the project can be associated with another tool chain so can I take a look at GCC or any more reasonably priced (of course I'd rather prefer free software) toolchain?

3. If yes: how can I use GCC with Cube?

• You can use gcc with any flexible IDE of your choice. – Chris Stratton Feb 3 '15 at 17:36
• @ChrisStratton how can I use GCC? I see only IAR, Keil and Atollic's toolchains in the selection. All are pricey :( – Roman Matveev Feb 3 '15 at 17:57
• You would have to install it yourself and customize the IDE to drive it directly or via a Makefile build or some other build driver. It is quite do able in general (though who knows about your particular IDE), but you are on your own with the details. In other words, you can pay or you can learn. I choose the latter because it is cheaper for personal projects and because it more flexibly fits into existing or desired organizational software development practices for professional ones. – Chris Stratton Feb 3 '15 at 18:00
• You don't need it. Looks like it has some fun what-pin-does what features, but you have to weigh that against changing tools/practices every time you change chip vendors. – Chris Stratton Feb 3 '15 at 18:03
• Cube as an 'IDE'? Actually, from the documentation, Cube is only a tool for generating basic and 'repetitive' code like configuring the oscillator, setting the port direction etc. and not a full fledged IDE like EWARM or Eclipse. So that way, Cube 'requiring' other IDEs is no the case. It's only probably customizing the auto-generated code to suit these actual IDEs. We'll have to go through the documentation... – Sohail Aug 10 '15 at 11:57

## 4 Answers

For an IDE which offers some features like the Cube, I can suggest Coocox maybe worth a try. It's free, based on Eclipse and supports some of the STM boards out of the box.

From my understanding the CubeMX is just a code generator which will write you code (inside that folder you give it) where all the peripheral initialization is taking place. All other development has to take place in a normal IDE.

Update:

It was recently announced that Atollic Truestudio is now offered for free for STM32 users.

I guess that will give access to a higher end IDE and toolchain to a broader audience. I haven't used it, so I can't comment on it's features but built in hard fault analysis in the debugger could come in handy for example.

I know it's an old post, but this might help others...

Don't confuse toolchain with IDE. You might consider the IDE to be the last link in the toolchain, but a toolchain does not necessarily imply an IDE. Eclipse is an IDE that connects to many different toolchains. In my case (ARM gcc build [linker, compiler, assembler, etc] + automake) is my toolchain.

I don't use an IDE. I take the generated source code from CubeMX and write makefiles to compile it in the manner I choose. The toolchain option in my CubeMX options is TrueStudio because that option generates a nice linker script that I can easily change. This, despite the fact that I don't use (nor intend on using) TrueStudio.

If you want to use gcc, great. But IDE selection is largely an independent choice, unless the IDE you've chosen foists some other compiler on you. If you really want an IDE (IMO, they get in the way more than help), you might have to choose one that mates up with automake (Makefiles) or gcc directly. Eclipse is the only one I know of.

Some compilers have different conventions for handling preprocessor-level constructs (macros, pragmas, conditionals, etc...) but the actual source code won't vary much.

I would try the toolchain from Leaflabs that they use for their Maple hardware. The Maple is an Arduino style board running an STM32 Cortex M3 processor. They give the toolchain away with the IDE and the IDE runs windows, so the toolchain may work for your situation. No guarantees of course.

• In translation, the Maple environment comes with windows binaries for a bare metal arm gcc, just as the Arduino environment comes with binaries for avr-gcc. – Chris Stratton Feb 3 '15 at 18:09
• Yup. That's pretty much it. – MDMoore313 Feb 3 '15 at 18:10

All tools have a restricted, but free version....

Despite I am in the same shoe like you, I use GUN/Linux, unfortunately all of the tools above run under WinOS.

After some search I found a solution. I will test soon carefully, but before I share the solution: Read the blog post of Baoshi. He has a description and a Makefile file generator.

Some addition: With the newest Cube I need hack because Cube do not generate right *.ld file for F0, so I copied from an another tools *.ld for the same target. Maybe it is a Linux related question.

• Welcome to EE.SE. Please add some of the information from the link to this answer. Link-only answers are discouraged, as the link may be unavailable at a later date. – Null May 2 '15 at 18:27