Arduino Extension for Visual Studio Code
This is the second test with Visual Studio Code, this time with the dedicated Arduino extension.
The Arduino extension requires the C/C++ extension, both developed by Microsoft. The Visual studio Code website provides all the required documentation for configuring Visual Studio Code. |
Visual Studio Code with the C/C++ and Arduino extensions
|
Using the Experimental Arduino Extension
This extension requires the Arduino IDE to be installed and actually acts as a front end. All tasks are performed by the Arduino IDE, with a nasty splash screen shown each time (pictured).
At launch, Visual Studio Code requires an internet connection and goes through a lengthy download of platform files (pictured). At launch, Visual Studio Code requires an internet connection and goes through a lengthy download of platform files (pictured). Unfortunately, the extension still relies on arduino_builder, the Arduino proprietary build manager, both slow and non-standard. |
I like the integration for the board selection, as well as with the Board Manager (pictured) and the Libraries Manager.
All those features require to press cmd-shift-P on macOS or ctrl-shift-P on Windows to call the command menu, then type Arduino and select Arduino: Boards Manager. Let's hope next iteration of this extension will feature a native build manager. |
New release 0.2.3 features debugging, based on OpenOCD.
Only a very limited set of boards are supported, as very few Arduino boards feature a built-in debugger. Interestingly, Microsoft is promoting its own board, the Microsoft Azure IoT Developer Kit. I set two breakpoints (one standard and another conditional, (pictured) and one watchpoint against the Arduino M0 Pro board. The procedure is well documented at the Debug your Arduino code with Visual Studio Code page. |
Conclusion
The biggest draw-back of the Arduino extension comes from the limitation of the extension, actually a mere front-end relying on the slow and non-standard Arduino proprietary build manager.
However, the extension is still at an early stage. Developers are working fast, and considering implementing support for another build manager, as spotted on the dedicated Gitter room. The source code is available at GitHub. In 2021, the Arduino extension has been dramatically improved. Many issues have been solved: the underlying Arduino splash screen no longer shows up every time, the whole extension runs faster. Now, with the release of the Arduino IDE 2.0 based on Eclipse Theia, the future of the Arduino extension isn't clear. |
Pros
|
Cons
|
Wrap-Up
|
Links
|
Posted April 17, 2017
Updated June 16, 2017, 18 Aug 2019, 03 Jan 2022