Embedded Computing
  • About
  • Blog
  • Hardware
    • Which Platform?
    • Controller Platforms >
      • Adafruit Platform
      • Arduino Plaform
      • BBC micro:bit
      • Espressif Platform
      • iLabs Platform
      • Raspberry Pi Platform (MCU)
      • Seeed Platform
      • Silicon Labs Platform
      • Teensy Plaform
    • Computer Platforms >
      • BeagleBone Platform
      • Raspberry Pi Platform (SBC)
      • UDOO Platform
    • Peripherals >
      • Shields
      • Grove System
      • Sensors
      • Actuators
    • Displays >
      • E-Paper Displays
      • Reflective Displays
      • TFT Displays
      • LCD Displays
    • Legacy Platforms >
      • chipKIT Plaform
      • 4D Systems Platform
      • Intel Platform
      • LaunchPad Plaform
      • BoosterPacks for LaunchPads
      • LightBlue Bean
      • Maple Plaform
      • Mediatek Platform
      • Microsoft Azure IoT DevKit
      • Particle Platform
  • Software
    • Exploring RTOS with Galaxia >
      • Event Library
      • Semaphore Library
      • Mailbox Library
      • Timer Library
      • Clock Library
      • SWI Library
      • Task Library
    • Ultra-Low Power with EnergyTrace >
      • Ultra-Low Power with MSP430
      • Ultra-Low Power with Energia MT and Galaxia
    • Using Integers Instead of Reals
    • Going Python?
  • IoT
    • IoT Platforms: Which Hardware? >
      • Matter with Silicon Labs MG24
    • IoT Services: Which Solution? >
      • Recommended IoT Solutions
      • Platform-Specific IoT Solutions
      • Other IoT Solutions
      • Not tested IoT Solutions
      • Notification Solutions
    • Get Date and Time from Internet with NTP
    • Fast and Easy WiFi Connection with QR-Code
  • Tools
    • How to Start?
    • Reference >
      • Asking for Help
      • Boards Pins Maps
      • Ruler
      • Boards and Plugs
      • I²C Logic Level Converter
      • Standards for Connectors
    • Training >
      • Texas Instruments Workshops
      • Embedded Systems: Shape The World — MOOC edX UTAustinX UT.6.02x
      • Embedded Systems - Shape The World: Microcontroller Input/Output — MOOC edX UTAustinX UT.6.10x
      • Embedded Systems - Shape The World: Multi-Threaded Interfacing — MOOC edX UTAustinX UT.6.20x
      • Real-Time Bluetooth Networks: Shape the World — MOOC edX UTAustinX UT.RTBN.12.01x
      • Systems Thinking with Texas Instruments Robotics System Learning Kit
    • Books >
      • Getting Started with the MSP430 LaunchPad
      • Getting Started with Arduino
      • Arduino Cookbook
    • IDE >
      • The Battle of IDEs
      • More Options
      • Assessing the Next Generation of IDEs
      • Tools for Documentation
    • Equipment >
      • Saleae Logic Analyser
      • Rigol DS1102E Oscilloscope
      • XDS110 Debug Probe with EnergyTrace​
      • Segger J-Link Programmer-Debugger
      • Nordic Power Profiler Kit II
  • Projects
    • Libraries >
      • Master I²C Software Library
      • Date and Time Library
      • highView Library Suite
      • Others Libraries
    • smartDevices >
      • I²C smartColours Smart Sensor
      • I²C smartRFID Smart Sensor
      • I²C smartLED Display
      • I²C smartControls Smart Device
      • I²C smartWiFi Smart Device
      • I²C smartBLE Smart Device
      • I²C smartNode Smart Device
    • IoT Projects >
      • Remote E-Paper Weather and Message Board
      • Typie-Walkie with LoRa and E-Paper Screen
      • Typie-Walkie with E-Paper Screen
      • Remote e-Paper Pictures Panel
      • Remote e-Paper Messages Panel
      • Industrial IoT Project
      • Remote Contactless Temperature Monitor
      • Using Node-RED for IIoT
      • Low Power Home Network Weather Monitoring
      • Updated Low Power Home Network Weather Monitoring
      • Weather and Security Station with Blynk
      • SensorTag to Blynk Using Node-RED
      • Pervasive Reporting
    • AI Projects >
      • Colour Recognition with Neural Network
    • Other Projects >
      • Air Quality Monitoring
      • Driving a Large E-Paper Display with a Compact Xiao RP2040
      • Low-Power E-Paper Weather Station
      • Portable Particulate​ Matter Monitor
      • FRAM-based E-Paper Screen Controller
      • General Purpose 3.5" Screen
      • Colour Recognition with Neural Network
      • A Low Power Weather Station
      • Digital Volt-Amp-Watt Meter
      • Mobile Measurement with LCD Display
      • Screen with SRAM for GUI
      • Volt-Amp-Watt-Meter for Grove
      • Multi-Touch Project with CapTIvate

Visual Studio Code

I ran two tests with Visual Studio Code: the first with the makefiles from embedXcode, the second with the preview of the Arduino extension Microsoft is working on.

Three extensions are required:
  • C/C++ by Microsoft,
  • Native Debug by webfreak, replaced by Cortex Debug by marus25,
  • C/C++ Snippets by Harsh.

The Visual studio Code website provides all the required documentation for configuring Visual Studio Code.
Picture
Picture
Picture
Picture
Visual Studio Code and three extensions:
C/C++, C/C++ Snippets, Native Debug
Visual Studio Code sports a new logo, and localisations are now provided by a dedicated Language Pack extension.

Three new extensions:
  • Visual Studio IntelliCode by Microsoft brings AI to the already excellent Intellisense.
  • Cortex Debug by marus25 replaces Native Debug by webfreak.
  • Shortcut Menu Bar by Jerrygoyal brings a much awaited solution for a toolbar.
Picture
Picture
Picture
Picture
Picture
Visual Studio Code updated logo with language pack and new extensions: ​IntelliCode, Cortex Debug, Shortcut Menu Bar and Language Pack​

Using make and the makefiles

The first test uses the makefiles I've been developing for embedXcode since 2010.

​I was surprised by the very limited customisation I had to perform to support each of all those three operating systems, namely Linux Mint 18.1, macOS 10.12.4 and Windows 10. 
​
Picture
Picture
Picture
The editor features all the modern niceties, including auto-completion and contextual documentation.

​Here, the parameters for the blink() function are listed.
Picture
I targeted the LaunchPad TivaC, with a built-in hardware debugger, and the Arduino M0 Pro, one of the few Arduino boards to feature a debugger.

Building and linking, uploading and running were completed successfully against both boards.

​Debugging relies on OpenOCD, thanks to the Native Debug extension by webfreak.

​Standard breakpoint, conditional breakpoint (pictured), watchpoints, call stack, everything ran smoothly as well.
Picture

Toolbar, sort of

The Shortcut Menu Bar by Jerrygoyal brings a much awaited solution for a toolbar. It brings buttons to display the change window, change the active tab, beautify the code, list the files and open the terminal.

Two more buttons are added when the Arduino extension is installed: the Upload and Verify buttons.

From top to bottom: the standard Visual Studio Code toolbar; the Shortcut Menu Bar with the Arduino extension; the Shortcut Menu Bar without the Arduino extension.
Picture
Added buttons include Upload and Verify for Arduino,
​change active tab, beautify the code, list the files, open terminal 

Debugging

The Cortex Debug extension by marus25, actually based on the Native Debug extension by webfreak, makes debugging against Cortex-M much easier. It displays breakpoints, conditional breakpoint, variables, stack, registers, and supports J-Link, OpenOCD, PyOCD, STlink, Black Magic Probe.

Only three key parameters are needed:
  • Set servertype to openocd
  • Define the patch to arm-none-eabi-gdb at armToolchainPath
  • Set the configuration files for configFiles

On macOS, Visual Studio Code may complain arm-none-eabi-gdb isn't signed and block its execution. Just go through the code-signing procedure for arm-none-eabi-gdb.
Picture

Using the Arduino Extension

Please refer to the Arduino extension for Visual Studio Code page.

​The biggest draw-back of the Arduino extension comes from the limitation of the extension, a mere front-end relying on the slow and non-standard Arduino proprietary build manager. 
Picture
Picture

Conclusion

I've especially enjoyed those features:
  • Cross-platform support for major OSes.
  • Ease of expansion with extensions.
  • Advanced editor with auto-completion and contextual documentation.
  • Built-in debug facilities.
  • Version management based on GitHub.
  • Large versatility for languages and tools-chains, of which C++ and GCC with makefiles.

Contrary to Atom, Visual Studio Code brings more features in standard, like debugging, and recommended extensions, like C/C++.

The implementation with the makefiles from embedXcode is a clear winner over the Arduino extension.
​
Development is going fast, with one release a month. The team can be reached at this Gitter room.
Picture

In 2018

Microsoft has just release the 2018 roadmap and ​I'm somehow disappointed.

It looks like Microsoft has its own agenda, somehow disconnected from users' needs, as C / C++ may not have the hype or Python, Node, JavaScript, or TypeScript.

Better integration with make (i.e. by passing parameters on to, actually a show-stopper for me), better GUI options and documentation integration (e.g. with Doxygen) are low in priority, turning Visual Studio Code into a walled-garden.

Visual Studio Code was high on my recommendations, but those missing features —especially the integration with make— and the lack of them in a foreseeable future made me revised my opinion and demote Visual Studio Code.

Even with the new set of extensions, the roadmap for Visual Studio Code isn't clear for me. Microsoft seems to be over-reliant on the community for bringing improvements to the GUI and the integration with external tools, and doesn't realise the true potential of Visual Studio Code.

In 2021

Compared to the initial assessment in 2017, Visual Studio Code has now reached a level a maturity that makes it a highly recommended solution.

All the issues mentionned earlier have been addressed, some natively, other through extensions: integration with make, debugging, support of Doxygen, tool bar, as well as the Arduino extension.

New notable features include remote development, for example against a container on the same PC or against a remote Linux single board computer like a Raspberry Pi.

Pros

  • Great editor
  • Easy implementation of the makefiles
  • Support for Linux, macOS and Windows
  • Debug as standard feature
  • Recommended extensions

Cons

  • Limited GUI customisation 
  • Microsoft roadmap for Visual Studio Code?

Wrap-Up

  • Go for the implementation based on the makefiles
  • Responsive development team

Links

  • Visual Studio Code
  • Dedicated Gitter room
  • ​C/C++ extension by Microsoft
  • Native Debug extension by webfreak
  • C/C++ Snippets extension by Harsh
  • embedXcode
Picture
Picture

Posted 17 April 2017
Updated 16 June 2017, 20 Dec 2017, 18 Aug 2019, 03 Jan 2022

Powered by Create your own unique website with customizable templates.