Azure Sphere is a unique highly secure IoT platform. You focus on your solution, Azure Sphere deals with security, identity, certificates, reporting, tracking emerging attack vectors, mitigating, updating the platform, and application distribution to protect your solutions, customers, and reputations.
I started my Azure Sphere journey 2 years ago. I’d done plenty of embedded development, but I quickly realized there was a lot to learn about Azure Sphere. If this sounds like your journey, then do check out the “Combining Azure Sphere IoT security with Azure RTOS real-time capabilities” article. There are links to the Azure Sphere developer Learning paths for IoT Hub and IoT Central.
This article covers three community driven tools that may help kick start your Azure Sphere projects.
- Azure Sphere DevX
- Azure Sphere GenX
- Azure Sphere Hardware Definition Extension for VS Code and Visual Studio 2019
Azure Sphere DevX
Azure Sphere DevX is the library that underpins the Azure Sphere Developer Learning Paths on Microsoft Learn. The library has been split out from the Learning path to make it easier to use and it’s now used in several projects including the Altair 8800 on Azure Sphere, the Azure Sphere GenX projects, and several customer projects.
Azure Sphere DevX is an Open-Source community-driven library that is based on the Azure Sphere samples on GitHub and from real-life experiences building Azure Sphere applications. The emphasis here is on community-driven, the library is not an official Azure Sphere library, and community contributions are very welcome.
The library consists of convenience functions and data structures that simplify and reduce the amount of code you write, read, debug, and maintain and allows you to focus on the problem you are trying to solve rather than the underlying infrastructure code. The Azure Sphere DevX convenience functions are callback centric, the library looks after the infrastructure, and you write the code for the callback handlers. You have full access to the source code so you can learn how the library works.
The DevX library addresses many common Azure Sphere scenarios including the following:
- Azure IoT Messaging:
Implements connection management and simplifies sending messages along with application and content properties metadata.
- Azure IoT Hub Device Twins:
Handles Device Twin JSON serialization and deserialization along with a type system to validate data types received and sent.
- Direct methods:
Simplifies in-bound direct methods message processing and passes direct method payload to the associated direct method handler.
- Intercore messaging:
Provides a context model to simplify the passing of messages between high-level and real-time application cores.
- Event times:
Simplified API for all common Event Timer scenarios.
- Deferred updates:
You focus on when you want application and OS updates to occur rather than how to defer updates.
Visit the Azure Sphere DevX library Wiki to learn more.
Check out this video introduction to Azure Sphere DevX.
Azure Sphere GenX
Getting started with any embedded project always involves a reasonable degree of effort and this is true of Azure Sphere too. If you checked out Azure Sphere Developer learning Paths and Azure Sphere DevX then you will have noticed the library is very pattern and declarative based and it has made a great candidate for a code generator.
The goal of the Azure Sphere GenX code generator is to make it easy to create a project that has all the basic elements in place ready for you to start to implement your code. So, for example, a best practice for an Azure Sphere project is to include an application watchdog timer, and control the timing of application and OS updates with Deferred Update support. You will also invariably want your device to connect and communicate with the Cloud, and Azure Sphere GenX makes connecting and communicating with Azure IoT a breeze.
To use the Azure Sphere GenX generator you declare an application model JSON file with all the base features you want your application to have, you save the file, and the generator runs to create your application, you can update the application model as your ideas evolve and then you start your development with a lot of code in place. The generator doesn’t do everything for you, but it will help get up and running fast.
Azure Sphere GenX is a community-driven project, you can create or extend custom “recipes”, that are more focused on your project requirements. Community contributions to the project are most welcome.
Learn more from the Azure Sphere GenX wiki.
Check out this video introduction to Azure Sphere GenX.
Azure Sphere Hardware Definition Extension for VS Code and Visual Studio
Along with the focus on IoT security, one of the core strengths of Azure Sphere is the Hardware definition files. Azure Sphere hardware is available from multiple vendors, and each vendor may expose features of the underlying chip in different ways. The Hardware definition file provides an abstraction of the microcontroller peripherals. They also allow you to create more meaningful peripheral names.
The process of defining a Hardware Definition file can be error prone and time consuming. So, I’m excited to share a preview of a community initiative to build extensions for both Visual Studio Code and Visual Studio 2019 to simplify the process.
The extensions are being developed by a very talented team of university students at UCL (University College London). The extensions are under development and now is a great time to test out and provide feedback.
Head to the Azure Sphere Hardware Definition Tools GitHub repo to download and try out and be sure to raise any issues you find on the GitHub repo.
Be sure to leave comments here or on the related GitHub repos.
Dave Glover, Cloud Developer Advocate based in Sydney Australia, with a focus on IoT and Azure Sphere. I publish samples on my GitHub http://github.com/gloveboxes.