Close

Looking for alternatives to Arduino... there and back again.

A project log for Stylish!

A most stylish wearable music synthesizer! A real stylus based monophonic music synthesizer built into a giant trucker belt buckle!

t-b-trzepaczT. B. Trzepacz 10/01/2018 at 13:242 Comments

The Arduino environment is simple, but a bit too simple for somebody like me who has programmed with "real" development tools, like Visual Studio and CodeWarrior. I was really looking forward to having and actual debugger instead of just printf. 

So I looked around for something new for STM32. Unfortunately, just about every development system for STM32 is a modified version of Eclipse, which I despise. It's hugely bloated, and impossible to find anything if you are used to using any non-Linux GUI from the last 20 years. None-the-less, I resolved to give them a try.

It seemed like the standards were the well-liked System Workbench for STM32, the very similar Atollic, and Keil. 

Keil costs actual money, and people seem to hate it, so that was right out.

Atollic seemed to have a pay plan when I started, so I decided to focus on the free System Workbench. Early tests were decent, but I realized that there was no printf unless I wanted to use an external serial adapter. I tried some tutorials on how to do it over the debugging interface. Also, I really wanted to leverage the Arduino libraries. There seemed to be multiple solutions for using Arduino with Eclipse that should theoretically work with SW4STM32.

For some reason, they can't just make a set of C libraries that implement Arduino; they have to do some special shit. Extra control buttons. Different places for libraries. It's a mess, and it avoided all of my attempts to get it working. I finally had to wipe the tools and all of their libraries completely off the system to get things working again.

In the middle of this process, ST Microelectronics bought Atollic and made it their official environment. They also made it free. I figured that this was the way to go, even though I had a slightly higher opinion of SW4STM32. I got this running, but once again, Arduino was eluding me, and I still had no printf. In hindsight, perhaps I could have done it over the USB port the same as the Arduino environment; maybe someday I'll try that again.

I really liked the Visual Studio Code based environment of Atmel Studio, and so I looked around for something based on that,. PlatformIO is a thing, and it shows up in free software lists, but it is really not free if you want to use the debugger. I remembered messing around with it for Teensy and that it had some strange way it handled libraries that wasn't compatible with me using my own modifications to the libraries. Maybe I could have figured it out, but not free is a problem, so I dropped it.

In any event, after months of messing around, I ended up back at the Arduino environment. The libraries mostly work, printf is supported, and it didn't take long to "get to blinky". Getting *beyond* blinky took a bit more effort, and I was having a lot of trouble getting a fast enough PWM output despite some helpful folks on the net sharing some code.

I also determined that the Mozzi audio libraries for Arduino actually work on STM32, and that kinda clinched the deal. So after all that, I'm back at Arduino IDE.

Discussions

Jan wrote 10/01/2018 at 14:04 point

Interesting write-up! I did the same search often and always came back to the shitty but working Arduino "IDE". I think I'll finally do the switch to Visual Studio (free version) with Visual Micro installed. That's 30$ but at least you get a debugger, simulation of PIN states etc.
What annoys me most is that there's still no autocomplete in the IDE. How long has it been around?! Even notepad++ offers autocomplete...

  Are you sure? yes | no

T. B. Trzepacz wrote 10/01/2018 at 14:55 point

Now that there is an official CLI version of the Arduino compiler, it might be easier to use it with Visual Studio, or any other configurable IDE. Still doesn't get one a debugger, tho.

  Are you sure? yes | no