{"id":28412415,"url":"https://github.com/eclipse-threadx/iot-devkit","last_synced_at":"2025-06-25T23:31:56.761Z","repository":{"id":272629148,"uuid":"916544986","full_name":"eclipse-threadx/iot-devkit","owner":"eclipse-threadx","description":"This guide is focused on the MXChip IoT DevKit (AZ3166).","archived":false,"fork":false,"pushed_at":"2025-02-02T07:42:30.000Z","size":39394,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-06-24T12:41:17.686Z","etag":null,"topics":["eclipse-threadx","iot","iot-device","iot-hub","mcu","microcontroller"],"latest_commit_sha":null,"homepage":"https://threadx.io","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eclipse-threadx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-14T10:02:06.000Z","updated_at":"2025-06-07T07:19:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5551a273-b0d3-4213-be4f-c72ed9a84fb1","html_url":"https://github.com/eclipse-threadx/iot-devkit","commit_stats":null,"previous_names":["eclipse-threadx/iot-devkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eclipse-threadx/iot-devkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-threadx%2Fiot-devkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-threadx%2Fiot-devkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-threadx%2Fiot-devkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-threadx%2Fiot-devkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipse-threadx","download_url":"https://codeload.github.com/eclipse-threadx/iot-devkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-threadx%2Fiot-devkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261972812,"owners_count":23238539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eclipse-threadx","iot","iot-device","iot-hub","mcu","microcontroller"],"created_at":"2025-06-02T21:19:29.029Z","updated_at":"2025-06-25T23:31:56.729Z","avatar_url":"https://github.com/eclipse-threadx.png","language":"C","readme":"\u003c!--\n  Copyright (c) 2024 Eclipse Foundation\n \n  This program and the accompanying materials are made available \n  under the terms of the MIT license which is available at\n  https://opensource.org/license/mit.\n \n  SPDX-License-Identifier: MIT\n \n  Contributors: \n      Frédéric Desbiens - Initial version.\n\n      Andy Riexinger - Documentation for Mac M1.\n\n--\u003e\n\n# Eclipse ThreadX IoT DevKit Starter Application\n\nThis starter application is an adaptation of a sample developed originally by Microsoft. The original code can be found here:\n\n[https://github.com/eclipse-threadx/getting-started](https://github.com/eclipse-threadx/getting-started)\n\nWe removed code providing support for Azure IoT Cloud. The only board supported is the MXChip AZ3166 for the time being.\n\n## Cloning this repository\nEclipse ThreadX and Eclipse ThreadX NetX Duo are included as submodules.\n\nWhen cloning, you must specify the `--recurse-submodules` option to get the code for the submodules. If you forget this option, just run the following commands in the root folder of your clone. \n\n```\ngit submodule init\ngit submodule update --recursive\n```\n\n## Prerequisites\n\n### Computer\nTheoretically, any recent laptop running Windows 11, Linux, or MacOS should do.\n\nWe tested on the following environments:\n- Windows 11 24H2 (Version 10.0.26100.2161)\n- Ubuntu 22.04.5 LTS (Windows Subsystem for Linux version 2.3.24.0)\n- Mac M1, macOS Sonoma 14.6.1 (23G93), native\n- Mac M1, macOS Sonoma 14.6.1 (23G93), Parallels Desktop for Mac Version 17.1.7 (51588), Ubuntu 22.04.5 LTS\n\n\n### IoT DevKit\nThis sample is preconfigured to work with the [MXChip AZ3166 board](https://docs.mxchip.com/en/nr6ggk/blyezpv6gkqicywi.html).\n\nThis board can run Eclipse ThreadX but is also Arduino compatible.\n\nThe board features a [STM32F412RG MCU](https://www.st.com/en/microcontrollers-microprocessors/stm32f412rg.html) from STMicroelectronics. The MCU is clocked at 100Mhz and comes with 1 Mbyte of flash memory and 256Kbytes of SRAM.\n\nThe AZ3166 has the following hardware onboard:\n- 128*64 dot matrix OLED display: VGM128064\n- RGB LED lights controlled by P9813:\n- Temperature and Humidity Sensor: HTS221\n- Atmospheric pressure sensor: LPS22HB\n- Bidirectional mono audio ADC/DAC: NAU88C10, microphone and 3.5mm headphone jack\n- Six-axis accelerometer: LSM6DSL\n- Geomagnetic sensor: LIS2MDL\n- DC motor\n- Two buttons\n- three LED indicators\n\nThe board also features WiFi connectivity. However, only 2.4Ghz networks are supported.\n\nThis starter application is preconfigured to provide access to some, but not all, of the peripherals above.\n\n### Developer tools\nIn terms of tooling, all you need to work on the challenge is CMake, Ninja, and a suitable C compiler. Naturally, having Git installed could help as well. ;-)\n\nThe source code for ThreadX and related modules is very portable and compliant with all \"required\" and \"mandatory\" rules of MISRA-C:2004 and MISRA C:2012. Most modern C compilers should be able to compile it. The official build pipelines rely on Arm's embedded GNU toolchain.\n\nBelow are instructions to install the tools.\n\n**Ubuntu**\n```\napt install ninja-build cmake \n```\n\nThen, download and install Arm's embedded GNU toolchain, available at [https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads)\n\nThe following will download and unpack version 13.3.rel1 of the software to `/opt`.\n``` \nwget https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz\nsudo tar xJf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz -C /opt\n```\n\nTo test, you can run the following commands:\n```\nexport PATH=$PATH:/opt/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin\narm-none-eabi-gcc --version\n```\n\n**MacOS**\n\nFor Mac M1, we tested using version 14.2.rel1. Below are links to download. The install is similar to Linux. \n\n- Mac M1 native: [arm-gnu-toolchain-14.2.rel1-darwin-arm64-arm-none-eabi.pkg](https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-darwin-arm64-arm-none-eabi.pkg)\n- Ubuntu 22.04.5 on Mac M1 via Parallels Desktop: [arm-gnu-toolchain-14.2.rel1-aarch64-arm-none-eabi.tar.xz](https://developer.arm.com/-/media/Files/downloads/gnu/14.2.rel1/binrel/arm-gnu-toolchain-14.2.rel1-aarch64-arm-none-eabi.tar.xz)\n\n\n**Windows**\n```\nwinget install --id=Arm.GnuArmEmbeddedToolchain  -e\nwinget install --id=Ninja-build.Ninja  -e\nwinget install --id=Kitware.CMake  -e\n```\n\n## Compiling and running the application\nTo compile the application, simply execute the relevant script found in the `MXChip/AZ3166/scripts` folder.\n\nTo deploy your code on the AZ3166, just plug the board on your computer. When you do so, this will create a virtual drive and a serial port over USB. On my Windows laptop, the board appears as the `d:` drive and the `COM4` serial port. \n\nOnce compilation is finished, you will find the executable in the `MXChip/AZ3166/build/app` folder. The default filename is `mxchip_threadx.bin`. Just copy that file to the virtual drive and the AZ3166's boot loader will reset the board and execute your code. There is also a deploy script in the `MXChip/AZ3166/scripts` folder.\n\nYou can use any terminal application to connect to the serial port and monitor your application's output. Personally, we use Tera Term, which you can install using `winget`. Just make sure you set the baud rate to **115,200**. On MacOS, we used [SerialTools](https://apps.apple.com/de/app/serialtools/id611021963?mt=12) which you can install via the Mac App Store.\n\nIf you deployed this application without any changes, you will get the following output in your terminal:\n\n\u003e ```\n\u003e Scanning I2C bus\n\u003e ..........................0x1a...0x1e.0x20...........................0x3c...............................0x5c..0x5f..........0x6a.....................\n\u003e\n\u003e Starting Eclipse ThreadX thread\n\u003e \n\u003e\n\u003e Initializing WiFi\n\u003e ERROR: wifi_ssid is empty\n\u003e ERROR: wifi_init (0x00000043)\n\u003e ERROR: Failed to initialize the network (0x00000043)\n\u003e ```\n\n### WiFi configuration\nTo connect the board to a WiFi network, edit the following constants found in `cloud_config.h`:\n\n- `HOSTNAME`\n- `WIFI_SSID`\n- `WIFI_PASSWORD`\n\nMake sure to select an appropriate value for `WIFI_MODE` as well.\n\nIf the WiFi is properly congiured, you will get the output below at application startup:\n\n\u003e ```\n\u003e Initializing WiFi\n\u003e       MAC address: C8:93:46:88:6F:9E\n\u003e SUCCESS: WiFi initialized\n\u003e ```\n\n## Where to go from here\nThe starter application provided in this repository simply initiates the board and WiFi connectivity.\n\nWe will eventually deliver updates showing how to access the sensors and publish data over MQTT and HTTP. Stay tuned!\n\n\n### Networking support\nNetX Duo is a comprehensive TCP/IPv4 and v6 network stack. It offers built-in HTTP and MQTT clients, among other things.\n\nIf you need a local MQTT broker for testing, we recommend using Eclipse Mosquitto. Here is how to install it.\n\nYou will find the Eclipse ThreadX documentation here: [https://github.com/eclipse-threadx/rtos-docs](https://github.com/eclipse-threadx/rtos-docs)\n\n**Ubuntu**\n```\napt install mosquitto mosquitto mosquitto-clients\n```\n\nThe mosquitto-clients package installs the `mosquitto_pub`and `mosquitto_sub` utilities.\n\n**Windows**\n```\nwinget install --id=EclipseFoundation.Mosquitto\n```\n\nThe Windows installer provides the `mosquitto_pub`and `mosquitto_sub` utilities. The default installation directory is `Program Files\\mosquittoC:\\Program Files\\mosquitto`.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-threadx%2Fiot-devkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipse-threadx%2Fiot-devkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-threadx%2Fiot-devkit/lists"}