Containerized tool chain to simplify IoT device development

Liya (Liki) Du


We are excited to announce the preview of a new feature enabled in Azure IoT Device Workbench extension in VS Code (part of the Azure IoT Tools extension pack now) to simplify the device cross-compiling tool chain acquisition effort for device developers working on embedded Linux devices (e.g. Debian, Ubuntu, Yocto Linux…) with Azure IoT by encapsulating the compilers, device SDK and essential libraries in Containers. All you need is to install or upgrade the IoT Device Workbench and get started developing within the container, just like today you are using a local environment.

Why container?

Just like the VS Code team experienced the development trends that Python, Node.js developers want “boxed” containers and virtual machines and use VS Code to develop on top of them. From our own experiences on building IoT tooling and IoT DevKit, we learnt that setup and configure cross-compiling tool chain is a fundamental step. And it soon gets error-prone and complex when device developers need to work on not just device logic but also connecting the device to the cloud, with extra SDKs and packages should be included.

For team collaboration, we saw device development team use shared compiling VM so that the entire team can compile the device code in a version consistent environment, which is critical for device development.

Another observation we got is toolchain setup for MPU (e.g. ARM Cortex-A series) devices was less mature than MCU (e.g. ARM Cortext-M series) devices. Since for MCU devices, there is generally IDEs such as Keil, IAR that provides the tool chain well integrated in them. While for MPU devices, developers use editors like VS Code, VIM or Notepad++ for code editing and compiling everything via CLI either on local machine or shared VM.

All of these learning, together with the recent debut of VS Code Remote Development, make us take the move to simplify this flow for device developers.

How does it work

We provided base images by archetype (e.g. ARMv7, ARM64) containing cross-compiling tool chain, Azure IoT device C SDK and other essential libraries (e.g. OpenSSL, zlib). The extension uses VS Code Remote to map the device code you created on your local machine to container and compile within it.

When developing an embedded Linux device:

  1. Create project using Azure IoT Device Workbench with the sample code and settings.
  2. For the first time running, it pulls the toolchain image from Microsoft Container Registry.
  3. A new container is created from the cross-compiling toolchain image.
  4. All compiling happens within the container and spit the compiled binary into local ‘.build’ folder.
  5. Last, it uploads the compiled binary via SSH to target device.

Try it now!

All the prerequisites you need to play around with it are:

Visual Studio Code, with version >= 1.35.1 Docker Desktop / CE

And of course, an ARM Cortex-A device such as Raspberry Pi or i.MX 6 that running Debian or Ubuntu. Then follow the get started guide on Github to start building your Azure IoT device application.

And please submit an issue if you run into problems, have feature suggestion or even just want to chat with us 🙂 For answers to common questions, see the FAQ.

Happy device development!


Discussion is closed. Login to edit/delete existing comments.

  • Daren May 0

    A great simplification for developing against the Linux style devices. Are there any plans/timelines for the toolchain for MXChip/Arduino devices?

    • Liki DuMicrosoft employee 0

      Hey Daren, we definitately do have plan to support it in the near future. Will keep you updated on it.

Feedback usabilla icon