Platform.io for embedded development

in #technology2 years ago

Platform.io for embedded development

Hi guys ! A very short post relating my fresh experience with Platform.io (https://platformio.org/).

To keep it short: it is pretty cool, easy to setup and simple to use !

From time to time, I need a small pause on the slicer development part to breath out. I have a few STM32 Nucleo boards that are more or less dust catcher since several months (to not say years...). I used to setup the cross compiler and perform the tedious work of setup my whole environment manually (debugger, uploader, libs ...). So, I was thinking why not give a try to Platform.io.

Installation

Super easy, just download and install Visual Studio Code, go in the plugins and search for Platform.io then install.

Setup First Project

Select the board and the target platform you want to install. For my STM32 Nucleo boards (FE411 and FE446), I had the choice with Arduino and Arm Mbed, I prefer the second one. Platform.io setups the whole thing cross-compiler, download the library and setup the thing. The only issue I had was to add under Linux myself as part of the dialout group to enable uploading the firmware to the board. In less than 30 minutes you can start tweaking small firmware and play with it.

Basically, there are few main rules for the project: build, upload and launch the serial terminal.

Customize Project

There are a few parameters that can be setup for the board you are using, kind of debugger/upload, serial port used. The complexity of the setup is low, making it easy to setup and to fix. It seems easy to add an unsupported board if you are doing custom hardware, which is pretty important.

Examples:

Drawbacks

  • Loosing a bit the control on the whole chain, need to dig further which version for the compiler toolchain, debugger/uploader, libraries and so on.
  • Visual Studio Code is not the best editor, some automated corrections are painful and sometimes buggy.
  • Few libraries for Mbed, but it is not a big deal, it is easy to handle that in a project by project basis that gives more control.

Conclusion

The integration within Visual Studio Code is pretty good and the experience really nice. The stability is good, It is an effective tool for daily tinkering. The ability to support multi-platform and multi-environment makes it a killer feature: it is very error prone and time consuming to setup such cross-platform environment for any kind of board. Very happy to play with this tool, even if it a bit young and not mature, it has a great potential and it enables anyone to start programming those little funny micro-controllers very quickly and with ease.