Which IDE Should I Use?

Integrated Development Environment (IDE) is a beneficial tool to speed up the development process. It usually consists of a source code editor, local building automation, and debugger combined into a single graphical user interface (GUI). There are many IDE options to choose from. We show some excellent options for you to start coding for our use case (i.e., developing Vitro Shard applications).

The goal is to give developers an overview of how specific IDE is suitable for Vitro Shard development. The document is based mainly on our experience and some subjective opinions. Although there will be some ranking present at the end, you can still use your favorite IDE. We have prepared few propositions, introduced the pros and cons of each one, and confronted against two use cases:

  • Development using Mbed OS and our SDK - compares IDE in terms of developing applications utilizing Mbed OS and our SDK (vitroio-sdk). Those components are currently in use and are obligatory in every application.

  • Development of clean STM32 - compares IDE in terms of developing applications directly for STM32 without any external libraries. As Vitro Shard is delivered without any firmware, there is the possibility to run any custom one. It only must be compatible with STM32L486RG MCU and Carrier board's connections, e.g., Vitro Shard Edge.

Development using Mbed OS and Vitroio SDK

Currently, every application is based on Mbed OS, and it includes the vitroio-sdk library. Those two components are indispensable and can't be omitted in any application. As such, the code structure and the API are determined.

The API does not restrict which API you should use, however, there is one restriction caused by using Mbed OS in application - a proper building environment called mbed-cli. When having a correctly working environment, the application building process is limited to invoking few commands. This process is well-documented in Mbed CLI official documentation.

The above considerations show that developing an application for Vitro Shard when using Mbed OS might be defined as IDE-independent. All restrictions are related to Mbed CLI and the building environment. Moreover, the entire process is done in the command line only. Therefore, we will describe a few IDEs that are good for development and try to point out why we recommend them.

Development of clean STM32

The Vitro Shard microcontroller is STM32L486RG, which is based on Arm Cortex-M4. The carrier board doesn't have any additional processor, so it is the only MCU present on the device. Moreover, Vitro Shard does not have pre-programmed flash memory. Therefore, it is possible to write your application independent from Mbed OS or vitroio-sdk, as previously mentioned. Hence, there are no restrictions in code development, structure, or building process. As such, there should be few main aspects to consider when choosing your IDE:

  • If there is a user-friendly and intuitive interface
  • If there are debugging tools already included
  • If building and flashing application is possible via 'just one button push' - no specific commands must be invoked manually by the developer
  • If there is an extension for MCU initialization and configuration
  • If the project structure is orderly and it is easy to add a library or exclude some files

At first glance, it doesn't seem complicated to choose the best IDE for your project. However, as presented in the following sections, every IDE focuses on some parts more than others. That's why they are so varied, and each one has its followers.

IDE overview

Visual Studio Code (VS Code)

1240

Visual Studio Code interface.

It is a free IDE developed by Microsoft, created in customization convention. It doesn't need any self-specific files, layouts, etc. You can open whatever project, or even directory, you want in that IDE. Its customization is based on extensions, which are available but not installed by default. For example, to support a dedicated programming language, the user must install a related extension only. Without it, there will be no hints displayed, code won't be multi-colored, and dependencies between files won't be recognized. However, not every user needs every extension. That is why this approach is comfortable and logical.

🚧

For Vitro Shard development, it is necessary the C/C++ extension. However, if there are any missing packages, VS Code informs the user about them as well.

Moreover, VS Code has a very convenient feature: a built-in terminal. Besides running standard commands, it also supports git. Therefore, it makes a complementary tool for code development and contribution. Another advantage is VS Code's simplicity and clarity. As the source file structure is relatively unrestricted, users may organize every directory and subdirectory independently.

VS Code doesn't have an already integrated general 'building mechanism'. As it can be customized, the building process is also covered by this feature. There are two possibilities to build binary:

  • Use command line and dedicated Makefile created manually outside the Visual Studio Code.
  • Use dedicated extensions and .json files to auto-generate Makefile and hook it under the 'build' button.

The first option gives more control to the developer and is universal. However, the second approach would be faster and more convenient if everything is configured correctly.

In terms of developing applications using Mbed OS, there is the possibility to import and build such projects in VS Code. The project must be exported from Arm Mbed CLI as described in official instruction. Next, all necessary tools must be installed and configured. Finally, the code can be properly imported.

When a developer wants to create an application for clean STM32, there is the possibility to integrate CubeMX into VS Code.

📘

STM32CubeMX (or CubeMX) is a tool developed by STMicroelectronics which allows you to configure MCU, enable peripherals and generate initialization C code for Arm Cortex-M core in an interactive, graphical way. More about it can be found here

This integration can be done using, e.g. stm32-for-vscode extension or directly by using e.g.
VS-Code-STM32-IDE.

Debugging

Debugging in VS Code is possible for both types of applications: Mbed OS and clean STM32. However, both demand slightly different tools:

Summarize

Pros:

  • Free for both private and commercial use.
  • Simple and clear interface.
  • Customization via packages and extensions.
  • Built-in terminal.
  • Handy for application development.
  • CubeMX can be integrated into a project.
  • Possibility to debug 'clean' and Mbed OS applications.

Cons:

  • Some bugs, which can be frustrating, are still present.
  • Own Makefile (or another building tool) must be provided when developing an application from scratch and without any dedicated extension.
  • Some customization processes are not so trivial and can be difficult for beginners.

STM32CubeIDE

1240

STM32CubeIDE interface.

It is free IDE developed by STMicroelectronics. It combines two other software: Atollic TRUEStudio for STM32 and CubeMX. As a result, there is an Eclipse-based IDE with already integrated CubeMX. It is a product dedicated to projects which are developed for STM32 microcontrollers. Unfortunately, it still doesn't have official support for ARM Mbed OS yet. In practice, Mbed OS applications or examples can't be opened in STM32CubeIDE out-of-the-box. The developer needs to introduce some code changes to have it working. That issue is described in mbed-os repository as well. However, please notice that it is still possible but might be difficult for inexperienced users.

📘

Atollic TrueSTUDIO is a C/C++ IDE built on Eclipse, CDT, GCC and GDB.

On the other hand, STM32CubeIDE is great when developing applications from scratch. It supports many ST MCUs and development boards. It has two main advantages over the competition:

  1. It is an official STMicroelectronics product, so it is focused on STM32 support mainly.

  2. (Optional) It has CubeMX software already included. Therefore, MCU configuration and initialization can be done interactively.

The second item is optional. It is recommended if you are a starting out, but it might be a suboptimal solution. STM32cubeIDE interface is somewhat regular and user-friendly. Mechanisms like adding libraries or searching paths are the same as Eclipse. There are also buttons for building and flashing programs.

Moreover, there is the possibility to distinguish between debug and release versions of the binary. Many operations are done automatically, without user input. However, you can still adjust those operations and change them manually. Once again, it is automated to assist developers by default, but more advanced users can still do it mostly on their own.

Debugging

As described in the previous example, debugging can also be divided into clean STM32 and Mbed OS applications. If you want to code a clean STM32 application, everything is already built into the IDE. The experience is almost the same as in Eclipse too. Users can set breakpoints, step work, watch variables, stack, etc.

If you want to use our API, it is possible. However, the IDE must be properly configured. For complete instructions, please check here.

📘

Notice that the linked guide refers to Eclipse. As mentioned earlier, STM32CubeIDE is based on Eclipse, so the solution should also apply to STM32CubeIDE.

Summarize

Pros:

  • Free for both private and commercial use.
  • Out-of-the-box support for STM32 MCUs.
  • Simple and clear interface.
  • Handy for both application development and building.
  • For clean STM32 projects, building and flashing operations are automatically integrated.
  • Integrated CubeMX software for initial configuration and code generation.
  • Possibility to debug 'clean' and Mbed OS applications.

Cons:

  • No official support for projects based on Mbed OS.
  • Some automatically generated code or scripts are not optimized, and users must adjust them on their own.

Keil µVision

1152

Keil µVision interface.

It is a paid IDE µVision IDE (keil.com) developed by ARM and is intended for rather advanced users. It already has embedded compilers and toolchains. Its interface is designed in a simplified version. It can also be integrated with STM32CubeIDE, as shown here. Due to that reason, it has great support for STM32 MCUs - STM32L486RG is also supported.

📘

The free version of Keil IDE is available for STM32L0 and STM32F0 MCUs. As Vitro Shard uses STM32L4, the free version is not available to use.

Keil µVision supports development with Mbed OS. There are examples and tutorials on how to configure IDE and how to import Mbed OS applications. There are instructions for building and flashing binary files as well. Therefore, it is a good IDE for users that want to have everything in one place.

The same can be said for 'clean' STM32 applications. There is native support for most MCUs from the ST family, and it can be integrated with CubeMX. There are many operations done automatically, and the user doesn't need to delve into them. For example, Keil generated building and flashing scripts, and the developer needs only to press the button to run them.

Debugging

If you configure Keil µVision properly, you can also debug applications using Mbed OS. Configuration instructions are given in official ARM documentation. For a 'clean' STM32 application, the developer needs to flash the debug binary file, set breakpoints, and begin the entire process with the 'Debug button'.

Summarize

Pros:

  • Support for STM32 MCUs already included in IDE.
  • Simple and clean interface.
  • Code development, building, and flashing already integrated.
  • Able to import Mbed OS projects.
  • Integration with CubeMX.
  • Can debug 'clean' and Mbed OS applications.

Cons:

  • Paid IDE even for personal non-commercial use.
  • Might be too overwhelming for new users.

Final Thoughts

It is hard to decide which IDE is the best for Vitro Shard development. Depending on what features are the most important for a given user. Among a plethora of available IDEs, the most popular are the ones shown here. Either way, we can reach the following conclusion:

  1. If you are looking for IDE suitable for beginners and advanced users, doesn't require extensive knowledge about the building process and its customization, and has excellent STM32 support, choose STM32CubeIDE. The main advantage over the others is that all development tools are already included (or automatically downloaded) in one place. It is integrated with CubeMX, so starting a new project should be an easy task. However, it doesn't support Mbed OS projects out of the box. Indeed, using some hacks and mixing instructions found on the Internet, there is the possibility to run those applications. But this solution isn't reliable and is inconvenient for most types of users.

  2. If you are looking for IDE, which is free, minimalist by default, can be customized, and eventually run great types of applications (including Mbed OS-based and bare metal ones), choose Visual Studio Code. It is still a little buggy software, which lacks some utilities. However, it is open source and strongly supported by not only Microsoft, but the entire community. By using proper extensions, there is the possibility to run almost every type of project dedicated to STM32. A slight difficulty seems to be the lack of Makefile or any other building tool directly after project creation or import. However, as it is mentioned in this documentation, those issues can also be solved or workaround.

  3. If you are looking for a comprehensive IDE with built-in tools, great MCU support, and let you create and build projects for bare metal STM32 and Mbed OS project, choose Keil µVision. It is a complete solution for advanced users who want to have everything in one place and don't want to 'hack' or configure their IDE to have the project working. However, this IDE is not free, so many developers definitely won't take it into account. For Vitro Shard projects, it is one of the best solutions. For beginners, it may seem too broad and unintuitive at first. However, looking at functionality, it is one of the best IDE available.

All listed IDEs would be a good option for Vitro Shard development. In case it lacks some functionality; usually, there are some workarounds. Ultimately, the final choice is always up to the developer to make.


What’s Next