Skip to content

About

Arduino library and package for the MXChip IoT DevKit

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

 
 

Repository files navigation

IoT DevKit SDK

HomeTemperature maintained release

The maintenance branch is maintained for AaronWangTT/HomeTemperature from Microsoft's final 2.0.0 release. Core 2.0.2 carries forward the corrected dtostrf() formatting and opt-in SDK telemetry behavior from 2.0.1, and fixes the version returned by getDevkitVersion(). Core 3.0.0 changes the default package to the Azure-independent base profile and adds the separate AZ3166MulticastUDP transport used by multicast protocols such as mDNS. The Core does not depend on, bundle, or install ArduinoMDNS. Applications that need an mDNS responder choose and pin that dependency independently; HomeTemperature currently supplies its own ArduinoMDNS 1.1.1 dependency. Core 3.1.3 provides the transport-independent signed-package OTA staging engine and the directly tested production P-256 signature adapter. It supersedes the mutable Core 3.1.0 and 3.1.1 releases, which must not be indexed for HomeTemperature or published through Board Manager. It authenticates package metadata before erase, performs bounded streaming writes and complete Flash read-back verification, and binds activation to the verified in-memory session. HomeTemperature HTTP and UI integration remain separate application work.

The fork's master branch preserves Microsoft's archived upstream history and does not receive HomeTemperature maintenance changes. Submit maintained Core fixes, packaging changes, and release preparation through pull requests to maintenance. Core package CI validates the runtime version API, verifies repeatable base and Azure-enabled package builds on Windows and Ubuntu, and requires both hosts to produce byte-for-byte identical archives per profile. Windows compiles the base and Azure-enabled sketch inventories in separate parallel jobs while retaining profile-specific build evidence. For a committed profile-aware revision, run the package check with PowerShell 7 and GNU ar/nm on PATH (or pass their paths using -Ar and -Nm):

& .\tools\package\Test-Az3166BoardPackage.ps1 `
	-Revision HEAD -Profile base `
	-OutputDirectory .\artifacts

The package builder disables Git's automatic line-ending conversion and uses UTC ZIP timestamps without modifying the caller's Git configuration or environment.

The new default is base; request -Profile azure-iot for a complete board package with Azure support. Neither profile ships the original monolithic archive. Historical 2.x tags remain full packages with their original filenames and hashes, and reject a base-profile request. Working-tree changes are not included by -Revision HEAD; use staging for uncommitted source validation.

A release tag on maintenance must match the runtime version and record its one intended releaseProfile in the package layout. The manual Core release workflow requires the matching profile, explicit hardware/firmware-review confirmation, and confirmation that repository release immutability is enabled. It runs both-profile CI at the resolved tag commit and compares the selected artifact with CI before publication. It publishes only that profile for that version. Existing releases cannot be overwritten.

Release metadata supplies immutable archive fields for the separately reviewed Board Manager index update; the workflow does not edit that index or consumer repositories. Azure users must pin an Azure-enabled version: upgrading to a newer base release removes Azure support. See the separation and release plan for acceptance limits and the release process. Core 3.0.0 is published as the first base-profile release. Core release publication does not update the separately maintained Board Manager index or downstream consumers.

Core package CI continues to run automatically for pull requests and pushes to maintenance. Its uploaded files are short-lived workflow artifacts for comparison, not published Core releases.

This SDK is used to develop and prototype Internet of Things (IoT) solutions leveraging Microsoft Azure services and the MXChip IoT DevKit (a.k.a DevKit) which is an Arduino compatible board with rich peripherals and sensors.

With this SDK, you can use Visual Studio Code with Arduino Extension to rapidly build a full-fledged IoT application that integrates multiple services like Azure IoT Hub, Logic Apps and Cognitive Services.

Repository layout

Directory Purpose
src/core/arduino Arduino compatibility APIs and the Core version API.
src/bsp/az3166 Board adapters, startup integration, configuration, variants, and boot support.
src/extensions Core-hosted networking, HTTP, time, configuration, telemetry, and display services.
vendor Imported dependency bundles, headers, licenses, and prebuilt archives.
platform/az3166 Arduino metadata and the source-to-package map.
libraries Arduino library packages for board features and cloud integrations.
examples Standalone cloud, board, SPI, and I2C demonstration projects.
tests/host Runtime-version, WiFiUDP, and legacy IoT-client host tests.
tests/hardware Compile-gated device suites and manual HTTP/NTP hardware tests.
tools/test Shared host-test and sketch compilation drivers.
tools/package Validated staging, deterministic package builder, and verifier.
tools/provisioning Historical DICE enrollment utility; its build and runtime are not validated by maintained CI.
legacy Archived Jenkins, installer, deployment, and device-test tooling.
docs Structure and hardening plan.

The package map assigns every payload file to its installed location under the archive's AZ3166/ prefix. Both checkout staging and committed-revision packaging use the same validated map. Do not copy ownership directories directly into an Arduino installation; use Stage-Az3166Platform.ps1 or the build drivers. Library examples remain with their libraries. Profile membership, not the directory name alone, determines whether an extension is included. Azure configuration and Application Insights telemetry live under libraries/AzureIoT/platform, outside the library's sketch-selected source tree. Full-profile mappings still compile them in the Core; they are not copied into the installed Arduino library. The base provider and telemetry stub have no cloud behavior.

AzureIoT owns its serial logging helpers, which now compile only when that library is selected. The header name and C function names are unchanged; an external sketch including this header now selects AzureIoT instead of finding it in the Core. The OTA library provides the transport-independent signed-package staging API in OTAStaging.h. It validates authenticated metadata before erase, streams the raw image into the runtime OTA partition, verifies a complete Flash read-back, and binds activation to the current in-memory session. See the OTA library guide for the package format, state/error contract, cancellation bounds, and recovery limits. The original OTAFirmwareUpdate.h URL downloader remains a separately documented deprecated unsigned raw-image compatibility path.

The HTTP client carries its unchanged third-party http-parser snapshot, including the license. Its installed cores/arduino/httpclient/http_parser path is unchanged, and exact content pins preserve its vendor warning classification. The Core-hosted HTTP server now delegates optional cloud settings to a build-selected provider; its separate form parser rejects oversized URL-encoded values instead of silently truncating credentials. See the Azure IoT separation plan for the validated base/full boundaries. Base configuration keeps Wi-Fi settings but no Azure commands, credential fields, or cloud writes. The empty provider is selected instead of AzureConfiguration, not in addition to it; nonzero cloud option flags are currently ignored in base builds.

Tests

Core package CI runs package-map contract tests on Windows and Ubuntu. It uses Test-Az3166HostTests.ps1 to execute the runtime-version, timer, base/full configuration, WiFiUDP, OTA staging, and legacy IoT-client harnesses on Ubuntu. Tests run with AddressSanitizer and UndefinedBehaviorSanitizer where supported. Client tests use dependency fakes; configuration tests also exercise the real multipart helper. They do not execute the ARM-only vendor libraries or the real JSON parser. The corresponding checks also run during releases when the tagged revision contains those harnesses.

The installable AZ3166 signed OTA host tooling builds, validates, and verifies generic AZPKG001 packages. Its Python unit tests, fixed compatibility vector, and bytecode compilation run on both CI hosts. The tooling is not part of the Arduino platform package layout.

On Windows, Test-Az3166Sketches.ps1 compiles 14 base sketches and 17 full sketches using the same production staging code. Both include SensorStatus and VoiceRecord so Sensors and Audio coverage does not depend on cloud examples. Full also includes the two cloud examples and the Azure DPS link probe. Other library examples are not implicitly added. Base ELF files must have no Azure-only definitions; cloud probes must actually link Azure definitions. These are compile-only checks, not hardware execution or validation against live cloud services. tests/hardware/manual/HttpTest is an unbounded HTTP/NTP concurrency and memory diagnostic, not an automated pass/fail suite. Native build commands are in the CI workflow.

The sketch test script requires PowerShell 7 or later (pwsh), matching the CI shell. Windows PowerShell 5.1 (powershell.exe) is not supported.

Install the pinned toolchain and run the sketch checks from the repository root:

$tools = .\tools\build\Install-Az3166BuildTools.ps1 `
	-Root C:\a -DownloadCache C:\az3166-downloads
foreach ($profile in @('base', 'azure-iot')) {
	.\tools\test\Test-Az3166Sketches.ps1 -Profile $profile `
		-ArduinoCli $tools.ArduinoCliPath `
		-ArduinoDataDirectory $tools.ArduinoDataDirectory `
		-ArduinoUnitDirectory $tools.ArduinoUnitDirectory `
		-OutputDirectory ".\artifacts\sketches-$profile"
}

Add -Sketch .\tests\hardware\UnitTest to the sketch-test command to compile a single project. The toolchain root must not exceed 70 characters.

-OutputDirectory is required. Each sketch gets its own retained verbose log, build context, tool identities, compilation database, sketch-named firmware, raw and structured sizes, and intermediate build files. Nonempty output roots are rejected; choose a fresh output directory for another run. All requested sketches are attempted, and any build or evidence failure makes the command fail. -VerboseBuild remains accepted but output is always verbose. See build evidence and validation findings for the layout, CI artifact links, and the existing path-dependent binary caveat.

Package source paths, the archive splitter, and its inputs are resolved from the requested Git revision. Packaging still supports the historical AZ3166/src layout; the current release workflow only publishes approved profile-aware major versions. A temporary Git index combines mapped and generated artifacts without changing the caller's index or installed toolchain.

To run the host checks with native GCC and PowerShell 7:

pwsh -File ./tests/host/package/PackageLayoutTest.ps1
pwsh -File ./tools/test/Test-Az3166HostTests.ps1 -Sanitize

The host driver stages the mapped platform before compiling. Its -CompileOnly option is explicitly compile/link-only and does not run tests. Current release tags use the same host-test driver; older tags retain compatibility commands.

Contribution

There are a couple of ways you can contribute to this repo:

  • Ideas, feature requests and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, provide your ideas or contribute to existing threads.
  • Documentation: Found a typo or strangely worded sentences? Submit a PR!
  • Code: Contribute bug fixes, features or design changes.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Documentation

MXChip IoT DevKit

The DevKit board features ARM Cortex-M processors. At its core, it comes with a SoC module that combines the power of the ST Microelectronics STM32F412 processor and Cypress BCM43362 for WiFi. For on-board peripherals, it has an OLED screen, headphone and speaker output, stereo microphone and abundant sensors such as humidity & temperature, pressure, motion (accelerometer & gyroscope) and magnetometer.

Get a kit

You can purchase the DevKit from: https://aka.ms/iot-devkit-purchase. We have opened purchase channel on DFRobot, SeeedStudio and Plugable

Data / Telemetry

The maintained 2.0.1 release disables SDK system telemetry by default. Define ENABLETRACE=1 in the platform build flags to opt in. Microsoft's original privacy statement is available at https://privacy.microsoft.com/en-us/privacystatement.

About

Arduino library and package for the MXChip IoT DevKit

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages