# 6+ IDEs to debug the $2 STM32 BluePill Wassim wrote 04/02/2017 at 11:44 • 8 min read • Like # 2018 Update ## ST gets Atollic Yes, "almost 2018", update. Interesting to see as noted @Hamish with the link he posted, STMicro acquiring Atollic IDE that was classified in this review as the most efficient. That makes sense. ## VSCode rules over Where did I end up six months after this review, well to be honest I rarely need to debug, but sometimes I do, so I stick with VSCode for all of the plugins, scm integration, workspaces, intellisense,... although I did not investigate the possibilitiy to configure its debug capabilties. I code with multiple languages and this unique interface really helps. I even can open netwrok paths e.g. "\\IOSERV\pi\IoT_Frameworks", so that I work on the raspberry pi samba shared folder seamlessly from windows. ## mbed-os nice but patchy For the SW stack, I also switched to mbed, it saves a lot of pain, I had to patch it in this fork to support the STM32 BluePill, did not manage to push the change due to complicated testing environment. From performance point of view some drivers are really ugly when it comes to real time, so I had to break the os spirit and hard code some registers to improve the efficiency, sometimes by a factor x50 (SPI, PWM,...). Code available in the 20ish Hello world samples, and parts of the STM32 dongle of the IoT_Frameworks. ## debug only but debug good And for the rare cases when I need to debug (with breakpoints), I got an original segger Edu with its Ozone, it is not meant for code editing, but switching for debug gives a full feature set. So the dream of a unique IDE is still on going and keeps the below review still relevant. # Intro First I'd like to thank Hackaday for this$2 32-bit Arduino (with debugging) so I decided to share my investigation about the IDEs where you could debug with more convenience.

The target Platform is the STM32F103C8T6 BluePill, used with a Nucleo board for the STLink-v2-1.

# What is an IDE ?

• Minimal formula for an Integrated Development Environment

• the separation between the flash and debug is important as a flash can happen with any interface running from the application itself or as a bootloader, Over The Air or other,...
• needless to argue about if an IDE is really helping or making things more clumsy, less open, so I'd simply say that the more an IDE sticks with open standard the richer it would get and the more plugin you'd see around it => e.g. Eclipse

# Impressions Criteria

• How quick and easy do I get it running, if I mange to get it working at all.
• How easy can I import STs CubeMX generated code.
• How easy do I get the debugger working.
• Debugger possibilities, peripheral view,...

By the way, although CubeMX didn't work for me on the first time, going through it with the debugger helped me find a ridiculous configuration including both HSE and HSI flag at the same time, then I realized that it wasn't me but a known issue, so I added this note about it

void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;
RCC_PeriphCLKInitTypeDef PeriphClkInit;

/**Initializes the CPU, AHB and APB busses clocks */
// - Faulty line => RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_HSE;
//replace by following line
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;

# Impressions

This is not a professional evaluation, just first impressions from a user experience, if something is wrong, please give feedback.

## TrueStudio

• OS : windows / Linux / Mac
• Supported by CubeMx
• Eclipse based
• Debug even with peripherals
• From Atollic, free, no size limit, but commercial approach for locking features, ads, waiting window...
• Can debug the peripherals

Conclusion : Most efficient

## Gnu Arm Eclipse

• OS : Windows / Linux / Mac
• CubeMX needs a converter CubeMXImporter
• Free and open perspectives, no commercial purpose behind it.
• I managed to make OpenOCD work with it, but far from beeing out of the box, very long install procedure of scattered SW, I had to understand how OpenOCD works to know how to pass the config file as argument,...here is my config options : -f "bluepillF103.cfg" (content below)
source [find interface/stlink-v2-1.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
reset_config srst_only
• Debug is fine, and very important is to include the Pack so that it's possible to debug the peripherals, reading the doc carefully is very very important, otherwise just stick with another IDE, the pack manager help file that I missed in the first install (also here thanks diegooo666 for the hints).

Conclusion : My Favorite Option, because it's the most open, most complete, most standard as Eclipse is THE reference for open source IDE, I'm sticking with this one, and would use others just for verification and compare from time to time. I admit that if someone would contribute to make a special pack for one click install of an STM32F1 support, that would be awesome, I don't know how to do that.

## System Workbench

• OS : Windows / Linux / Mac
• supplied by ac6 but strong link with ST to provide it as an open source alternative.
• CubeMX support of course.
• works with OpenOCD

Conclusion : decent user experience, I keep it as alternative to compare if a bug arise or to check its eclipse config.

# IAR Embedded Workbench for STM32

• OS : apparently Windows only
• No room for comparison, best user experience, all is out of the box
• CubeMX support
• down side is that does not come for free, not at all, but relevant as a free edition can have up to half of the flash for the STM32F103C8T6
• best debug experience with all debug windows organisation, assembled view, peripherals,...

Conclusion : good IDE, but unfortunately not relevant as main platform for an open community, but keep it for quick, case specific debug.

## CoIDE

• OS : sounds also Windows only, weird as developers looking for free sw might not afford windows
• I have to mention it on this list, due to the very positive community feedbacks, although I did not manage to make it work.
• CubeMX might be similar to the gnu arm eclipse case, to check.
• not really out of the box. Multiple failed attempts just to download the SW which made me cancel the evaluation multiple times.
• Sounds free, but looks like it's an attraction to the CoLink debugger, which is a fair business as it also supports all sort of STLink, J-Link.
• It's eclipse based by hard to find the configurations which have been heavily customized, probably better for some but harder for users used to eclipse.

Conclusion : cannot recommend, probably because I did not spent enough time as much as for the other alternatives, but I'd appreciate to see direct support for CubeMX and the BluePill STM32 which are getting more popular and I' using them as reference, then would have potential to become THE IDE.

## uVision

• OS : also windows only, I talk of course about official support not wine and stuff like that
• same as the IAR professional environment, no room for comparision, and even I'd say this is at another league as it's using the armcc compiler.
• Very comprehensible package manager with all the samples, even beginners would feel comfortable.
• support for the CubeMX projects creation.
• Note that if you had a Free ARM-M0 and ARM-M0+ evaluation license before, you have to comment it from the TOOLS.INI file before enabling the default size limited support of the Cortex M3, otherwise you only get an error that the toolchain does not support the device.
• My plan was to stick with the STM32L062 which is ok for this environment so for the BluePill it only suffer from the same code size limit same as the IAR .
• Special thanks to @Sheldon for the hint and the link to the fix details

Conclusion : THE IDE, if you are rich or just have money. Or why not stick to 32KB design when possible, the runtime behavior if not more might be impacted if you use it just for debug then move to another compiler.

# More IDEs, Frameworks and Editors

• I did not had time to evaluate the Embitz.
• Arduino is from now on for me two separate things :
• The Arduino framework : good, nice, useful, simple
• The Arduino IDE : now that you have alternatives, who would stick with that ?
• mBed is an arduino like concept, although sounds more professional and complete.
• Platformio is a very nice framework that allows one click installs for multiple environments including but not limited to arduino, mBed and this into your favorite Editor Atom or Visual Studio Code.

To have a better understanding of what is platformIO and to compare Arduino, mBed and others, I started evaluating these frameworks in this project :

# How to turn into an STM32 expert ?

From the community feedback I decided to add the good books references in this section. I will avoid listing in this section books that are more expensive than the BluePill itself.

• The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors by Joseph Yiu (thanks @diegooo666 for the reference)

## Discussions

Rock Deng wrote 07/24/2018 at 03:14 point

TrueStudio got lots of improvements and I think it will be the best IDE.

Are you sure? yes | no

Hamish wrote 12/13/2017 at 12:16 point

Thanks for the useful write-up. Completely coincidentally - just yesterday STMicroelectronics announced the purchase of Atolic for USD 7M: http://www.st.com/content/st_com/en/about/media-center/press-item.html/c2839.html It will be interesting to see what happens to STM's System Workbench going forward.

Are you sure? yes | no

Wassim wrote 12/13/2017 at 17:01 point

Very interesting, we'll see how these will compete with Atom, VScode and PlantformIO with debug plugins.

Are you sure? yes | no

Wassim wrote 04/09/2017 at 10:28 point

After evaluating so many IDEs, I'm currently more into custom environments where you use your favorite Source Editor with command line tools, I still did not solve the debug question, so for debug Eclipse is still the only alternative, but I'm sure not for long...

The platformIO is a very convenient environment to test multiple libraries and Frameworks, as it's a build tool that supports really all of them, so here I use it with VSCode to compare mBed, Arduino and others

Are you sure? yes | no

diegooo666 wrote 04/05/2017 at 09:22 point

Are you sure? yes | no

Wassim wrote 04/05/2017 at 17:34 point

That's really cool, I didn't see that. But is it usable with any debugger or does it have to be with the J-Link, I think it is independent no ? I'll have a look.

Are you sure? yes | no

diegooo666 wrote 04/06/2017 at 10:12 point

I use it with OpenOCD and stlink v2.1 so I guess it has nothing to do with J-Link.

Are you sure? yes | no

Wassim wrote 04/06/2017 at 18:20 point

It's working now, it's always better when someone takes the time, and reads the doc.

Are you sure? yes | no

diegooo666 wrote 04/07/2017 at 14:39 point

Are you sure? yes | no

Tylor wrote 04/04/2017 at 15:57 point

Have you planned to review Embitz? It's super fast, free, and doesn't rely on CubeMx. Talk about a snappy debugging experience.. wow. I'm never going back to anything based on Eclipse.

https://www.embitz.org/

Are you sure? yes | no

Wassim wrote 04/04/2017 at 16:26 point

I'm planning to check it further, afterwards I would add a section for it, sounds as an interesting alternative.

Are you sure? yes | no

Ubi de Feo wrote 04/04/2017 at 15:31 point

I have just dipped my toes into STM32, as most of the work I do doesn't need more than an ATMega or ATTiny, but am enjoying a book by Carmine Noviello: Mastering STM32.
In his book, published via LeanPub, he goes through the ins and outs of the platform and helps the user configure a full toolkit as well as becoming proficient at working with the line of devices.

I've been looking into some good books and this is the one I've liked the most at least based on its first 5 chapters.
The IDE configuration sections are really well done :)

Are you sure? yes | no

Tylor wrote 04/04/2017 at 16:00 point

Sounds neat. Thanks for the book recommendation. I figure I might have to cave into Cube libs eventually.

Are you sure? yes | no

Wassim wrote 04/04/2017 at 16:30 point

Thanks for the reference, if you can pay for it, that's a real professional value not like reading internet blogs :)

Are you sure? yes | no

diegooo666 wrote 04/05/2017 at 09:25 point

The Definitive Guide to ARM Cortex-M3 and Cortex-M4 Processors by Joseph Yiu is also a highly recommended one to understand things in details.

Are you sure? yes | no

MobileWill wrote 04/04/2017 at 15:20 point

Embitz (Based on Code::Blocks) is my favorite so far for STM32. Since it supports make files you could use it with anything. Only limitation is it is only for Windows. It also has support during debugging for RTOS tasks. When you create a new project it has support for many microcontrollers and I have been able to import a CubeMX project as well.

Are you sure? yes | no

Tylor wrote 04/04/2017 at 15:59 point

I agree. I use it for STM32 on chibiOS, nOS, and it doesn't assume you want to use CubeMx. Lastly, it's really fast. I just did a 22k project rebuild in 2 seconds. Literally 2 seconds. Why is Eclipse so slow?

Are you sure? yes | no

MobileWill wrote 04/04/2017 at 16:02 point

I have been using Atmel Studio and it is painful every time I have to compile to test something. I throw on Netflix/Youtube so I can watch while I wait for it to compile and flash. I should see if I can do SAMD in Embitz. Eclipse is written in Java so it has more overhead.

Are you sure? yes | no

Guido wrote 04/04/2017 at 12:39 point

What did you not like in System Workbench for STM32?

Are you sure? yes | no

Wassim wrote 04/04/2017 at 16:35 point

Well, System Workbench is for me yet another eclipse based IDE, I'm happy to have it as reference, but if under the hood all is close to Eclipse, then the gnu arm plugins for Eclipse is a preferred solution as it's more standard environment. I think that the gnu arm eclipse is new and atollic is private, so without the gnu arm, then System Workbench would totally make sense.

Are you sure? yes | no

Wassim wrote 04/04/2017 at 17:03 point

by the way, more detailed notes about System Workbench

Are you sure? yes | no

Sheldon wrote 04/04/2017 at 09:54 point

On the Keil uV - I fell in to a similar trap; there is a free license for M0/M0+ support (specifically STM32F0 and STM32L0 - they're paid for by ST) but it then stops the size-limited support of other targets! (I was also wanted M3 support)

I'm not sure if it would support the "blue pill" board but it should certainly support the chip (I was even surprised that, while still code limited, it supported the high-end M7 cores) - it does support quite a wide variety of dev boards.

Also note, if you do install the special license, to remove it involves removing the license key from the ini file.

Are you sure? yes | no

bryan.rozier wrote 04/04/2017 at 12:24 point

Beat me to it! I use the free version of uVision too. MDK-Lite http://www2.keil.com/mdk5/editions/lite it's limited to 32KBytes but supports M3 etc.

I've used the paid for version of the Keil tools in a previous job. Absolutely rock solid. The  Keil debug probes are excellent too. (Clones are available!).

Are you sure? yes | no

K.C. Lee wrote 04/04/2017 at 12:42 point

I played with the Lite version of Keil previously.  It supports everything including the blue pill and other more obscure stuff beyond development boards that few played with here. (I skip development boards and go straight to proto build.)

You can switch out the compiler to GCC (within the project) when your grow beyond the 32K limits. This is sufficient to get you to some sanity and basic code. The draw back to GCC is that you lose all the goodies and pretty much only using the IDE.

I program in bare metal and used to squeezing my coding to old fashion 8-bit, so 32K is large enough for small projects. I have switched to the \$0.44 STM32F030 supported by the free version and couldn't be happier.

Are you sure? yes | no

Wassim wrote 04/04/2017 at 16:51 point

It's clear that switching the Keil to gcc would take the "power" out of it. Like on this project where I have a wireless and a fixed STM8 variants https://hackaday.io/project/20388-home-smart-mesh I'd like to replace the STM8S BluePill with the STM32 BluePill and the STM8L TSSOP20 with the STM32L0 LQFP32.

Are you sure? yes | no

Wassim wrote 04/04/2017 at 16:38 point

Thanks for the hint of the ini file, I got stuck with the M0/M0+ variant, I'll try that and check with the M3.

Are you sure? yes | no

Sheldon wrote 04/05/2017 at 08:09 point

This is the web page that explains it:

http://www.keil.com/support/docs/3756.htm

Are you sure? yes | no

Wassim wrote 04/05/2017 at 17:17 point

Thanks for the hint and the link, it was trivial (after you know it), now it's working, you saved an STM32 life here :)

Are you sure? yes | no