STM32 C/C++ IDE Review

I am constantly looking out for IDE’s to improve my productivity in Software, so I wanted to share with you my recent experiences in the area. This review focus on STM32 development.

  1. Visual Studio.

Having used Visual Studio since it came around as Visual C++ 1.0 some 20+ years ago it has always been my first choice if available. I have tried to replace it on Windows development several times because it used to be Windows only, but always ended up returning. These days, with Visual Studio being free and moving into Linux, Android, STM32 and Arduino to mention a few it’s not any discussion. I use Visual Studio because it is the best IDE out there.

The source code editor for C and C++ is great with a good editor and navigation. But, I could write source code in Notepad or Vi (actually have done) if it came to that – I can adapt to any editor.

The one thing that may me stick to Visual Studio is that “things work” – no fuzz or jumping around. Their debugger have always been the best talking as a Windows developer, but I have missed Visual Studio on Linux (Raspberry PI) and STM32.

These days this is not an issue – Linux support you get for free and STM32 is supported through the VisualGDB extension. For me this means I can develop Windows, Android, Linux and STM32 from within the same IDE.

The debugger in Visual Studio is important. You press F5 and your app start and you can single step, look at variables and do all the things you expect from a debugger – no fuzz because it works.

  1. Eclipse.

Eclipse have support for more or less every platform out there and is a good choice. I have recently started using Eclipse with “System Workbench for STM32”. This integrate with STM32CubeMX which makes it a good combination. CubeMX allows you to “wire” your chip and have driver code and setup generated. It is a bit fiddly to get started, but once you get it to work it really makes a difference.

As mentioned an Editor is an Editor. Eclipse is great for Java developers, but I write C/C++. So that is what you get – I have used Eclipse in many variations over the years and it’s great for what it is. I started to test this because friends who do not use Visual Studio talked about this for STM32 and it is decently good.

It can be a bit fiddly to get the ST-Link working at times + the debugger support seems to have room for improvement. I have not tested C++ on this yet, but so far I admit that this would be worth a try.

  1. CooCox IDE

This is also based on Eclipse and have for some time been my choice for STM32 development. They have a better grasp of embedded development with a good repository where you can pick up modules and a working help system. What I liked with CoIDE was that it was easy to get started and that St-Link always worked.

The reason I move away from this is because development seems to have stalled after version 1.7.8 which don’t support the new drivers from ST. I have tested their new Beta, but can’t get it to work properly.

Others…

Other options do exist. The commercial options have never really been an option + they tend to focus more on enabling bare minimum than being great.

Conclusion

For me it’s not really a choise. I have used Visual Studio for so many years and with Windows, Raspberry PI and STM32 so tightly integrated into the same environment it becomes to attractive. VisualGDB cost ca 80.- USD so this is not completely free, but it is worth it IMO.

I have not tried STM32CubeMX together with Visual Studio, but it should be straight forward – that said I only use CubeMX for testing. In real projects I set up my own HAL and organize code properly not outside the controll of any IDE – in fact I often maintain several IDE’s because different developers have different preferences.

16 x Servo Module – 1st draft

Just the first 3D draft of my Servo Module. I still have the Raspberry PI Zero W hanging on the back of this – we don’t need to populate that header, but had plenty of room for it so just left it there. on top left you see jumpers to select Servo and Servo Signal voltage. On right you see a classic 3 x 16 header for servo connectors with the photo coupler providing a complete isolated Servo module.

I have a few changes I need to do – firstly I want to investigate how to add a current sensor with full isolation – possible using a photo coupler.

Backbone Pinout Revision 5

The Servo Module forced me to think about isolation and made it obvious that I need 2 x 5V supplies in cases where 5V is used for Servo’s etc. I removed 48V as option simply because 48V is used for higher effects/currents. Pin 23/24 is now the 5V MCU supply that must stay isolated from the 5V/12V/24V PSU’s.

Photocoupler Schematics

I don’t show to much schematics in here simply because it’s a bit difficult to copy them into here, but had to show this – this is the first time I use a photocoupler. I decided to try PS2801 after realising that a long range of photocouplers use the same package. I am not sure about the resistor values as examples/references are a bit weak. The drawback with using photo couplers is that signal can only go one way and at a frequency of max 10KHz ++. The advantage is that the MCU is totally isolated.

Max voltage C->E is 40V, so if this works as I expect I input a 3.3V signal and get a 5V,12V or 24V out at 50mA. Just need to add jumopers allowing selection of separate Signal and Servo voltage. I will be using 4 of these circuits on the Servo Module.

Sadly this means I can’t use this module for input – I might have to add a separate digital input module – but, I will also look for more optional solutions – learning in progress 🙂

Micro/Pocket PC

This is a 5″ display and the keyboard I just ordered. I think the size is about correct. The trouble is more finding a TFT display that hide the HDMI on the back (inside) rather than demanding cables extending to the sides. I actually need a workable console for Raspberry PI that include both keyboard and display and don’t occupy to much space – interesting…

Pocket PC Keyboard

Not the most interesting topi, but this keyboard fit into my hand and accidentally have a layout that seems to be good for a developer. I ordered one to try out – actually could be an idea to make plug the keyboard into Raspberry PI and make a Pocket PC – it just need a 7″ display on top and a RPI Zero W + a battery.

PLC Modules – Update

I have dropped the GSM and Raspberry PI modules since the Ethernet module incude those. The ones with colors are coming up – thought I will also start focusing more on the rest of the network. I have produced several small mini modules in the past that I also want a new revision off.

STM32F105RC

I have written about STM32F105RB and why I chose this before. Sample prices on AliExpress do variate, but I noticed some batches of STM32F105RC for 1.8 USD each so I purchased 10 of them – they arrived today and I will stick one of them on a breakout board later. ST’s own price for this is 3.- USD, so I am not sure why I get these for almost half the price.

The sellers on the RB version advertise these as the 32Kb Versions, but I am not aware of a similar scheme on the RC. Frankly I don’t care either as long as they work as this is for prototype’s. The RC version have 256Kb Flash and 64Kb SRAM.

PLC Rack/Box

This aluminium box cost ca 16.- USD P&P included and is accidentally the correct size to mount 2 of my backbone PCB’s on the inside. I need to do a more exact scaling, but the concept is illustrated below.

To do this I need to make some PCB Holders. The ones illustrated below should be easy to pring with a 3D printer.

The Box have sufficient depth to hide a PSU behind the backbone to deal with mains input. Just an idea