azure-sphere-samples/HardwareDefinitions
Chris Whitworth d019b9f408
Docs update: (#212)
* Clarify requirements and language around hardware and hardware definitions
* Add note about flash wear to samples which write to storage
* Update networking docs now ethernet is now enabled by default
2021-07-05 12:06:58 +01:00
..
avnet_mt3620_sk Regenerate headers from AVnet SK definitions (#182) 2020-11-25 14:26:16 +00:00
avnet_mt3620_sk_rev2 Avnet mt3620 sk rev2 hw files (#164) 2020-11-25 13:02:11 +00:00
media Updated samples for 20.07 release. (#157) 2020-07-29 09:43:17 -07:00
mt3620_rdb 21.04 Release (#203) 2021-04-29 22:03:17 +01:00
seeed_mt3620_mdb Updated samples for 20.07 release. (#157) 2020-07-29 09:43:17 -07:00
usi_mt3620_bt_evb Updated samples for 20.07 release. (#157) 2020-07-29 09:43:17 -07:00
README.md Docs update: (#212) 2021-07-05 12:06:58 +01:00

README.md

Hardware definitions

Azure Sphere hardware is available from multiple vendors, and each vendor may expose features of the underlying chip in different ways. However, through hardware abstraction, the sample applications in the Azure Sphere samples repository on GitHub are hardware independent. They will run on any Azure Sphere-compatible hardware without changes to the code.

Hardware abstraction is achieved through the use of hardware definition files. The samples that require hardware definitions are written to run on an abstract sample appliance. For each supported board or module there is a hardware definition file called sample_appliance.json. This file maps the peripherals used by the sample appliance to the corresponding peripherals on the board or module. The contents of this file are used during the build procedure to update the app_manifest.json file and in compiling and packaging the sample.

For additional information, see Manage hardware dependencies and Hardware abstraction files in the online documentation.

Note: Hardware definitions are required only by high-level applications that use hardware peripherals. The following four samples do not use hardware peripherals and therefore do not require hardware definitions: DNS service discovery, HTTPS cURL Easy, Inter-core communication, and WolfSSL API.

Supported hardware

A hardware definition file, sample_appliance.json, is provided for each of the following Azure Sphere development boards.

Note: The Device to Cloud reference solution has its own custom hardware definition file for the RDB and the corresponding hardware reference design.

Set the target hardware for a sample application

The value of the TARGET_HARDWARE variable in a sample's CMakeLists.txt file specifies which development board is targeted by the sample. To set or change the target hardware for a sample application, complete the following steps:

  1. Clone the Azure Sphere samples repository or download the zip file from the Microsoft samples browser if you have not done so already.

    The target hardware definition files for the samples are stored in the HardwareDefinitions directory.

  2. Open the sample's CMakeLists.txt file, which is located in the sample's source directory.

  3. In the CMakeLists.txt file, find the code statement that begins with set(TARGET_HARDWARE.

    Note: This code statement will not be present in the sample's CMakeLists.txt file if the sample has no hardware dependency or if the sample uses a custom hardware definition file.

  4. Change the value of the TARGET_HARDWARE variable to match your hardware. For example, to run the sample on the Avnet MT3620 Starter Kit, the value of the TARGET_HARDWARE variable must be avnet_mt3620_sk as shown below:

    set(TARGET_HARDWARE "avnet_mt3620_sk")