Skip to content
Branch: master
Find file History

Hardware definitions

Azure Sphere hardware is available from multiple vendors, and each vendor may expose features of the underlying chip in different ways. This folder contains definitions specific to individual hardware implementations.

This README file describes how to set the target hardware for a sample and how to extend the sample hardware definitions to support additional hardware features.

For additional information, see Manage hardware dependencies in the online documentation.


The samples support the following Azure Sphere hardware:



Development Kits

Each folder contains a JSON file and a header file that maps the board- or module-specific features to the underlying Azure Sphere chip.

The identifiers that the samples use for Azure Sphere features are abstracted into a file named sample_hardware.json, which maps them to peripherals in the board- and module-specific files.

Set the target hardware for a sample application

To change the target hardware for a sample application, set the Project Properties to use the corresponding hardware definition from the samples repository.

  1. Clone the Azure Sphere samples repository if you have not done so already.

    Important: Clone the entire samples repository, instead of downloading an individual sample. The target hardware definition files for all the samples are stored in the Hardware folder at the top level of the repository.

  2. In Visual Studio, use Project Properties to set the Target Hardware Definition Directory for your hardware. The following example shows how to change the target for the GPIO sample:

    Target Hardware Definition properties

    The Target Hardware Definition Directory identifies the folder that contains the hardware definition files for the target hardware.

    In the example, the ..\..\..\Hardware\mt3620_rdb folder contains the sample_hardware.json file, which maps identifiers in the Azure Sphere sample applications to peripherals on an MT3620 reference design board, such as the Seeed MT3620 Development Kit.

After you set the target hardware, the sample_hardware.h file for the selected hardware is added to your project. This file contains the SAMPLE_* definitions for the peripherals that the samples use. Visual Studio supports Intellisense in this context, so you can hover the cursor over an instance of a SAMPLE_peripheral identifier in the code to see additional hardware details.

The contents of the sample_hardware.json file is used during the build procedure to update the app_manifest.json file and in compiling and packaging the sample.

You can’t perform that action at this time.