close-circle
Close

6+ IDEs to debug the $2 STM32 BluePill

Wassim wrote 04/02/2017 at 11:44 • 7 min read • Like

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 ?

Impressions Criteria

Small note about CubeMX

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

Conclusion : Most efficient

Gnu Arm Eclipse

source [find interface/stlink-v2-1.cfg]
transport select hla_swd
source [find target/stm32f1x.cfg]
reset_config srst_only

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

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

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

CoIDE

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

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

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

STM32 BluePill Frameworks Evaluation

https://hackaday.io/project/21045-stm32-bluepill-frameworks-evaluation

STM32 BluePill Frameworks Evaluation

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.

Like

Discussions

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

https://hackaday.io/project/21045-stm32-bluepill-frameworks-evaluation

  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

I'm glad i could help.

  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

https://hackaday.io/project/20879-notes-on-using-systemworkbench-with-stm32-bluepill

  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