page_type | languages | products | description | urlFragment | |||
---|---|---|---|---|---|---|---|
sample |
|
|
This sample demonstrates how Azure Sphere and Azure RTOS are able to run together on MT3620 Development Kit. |
azure-rtos-on-azure-sphere-mediatek-mt3620 |
This sample demonstrates how Azure Sphere and Azure RTOS are able to run together on MT3620 Development Kit.
This sample app for an MT3620 real-time core running Azure RTOS that creates several threads and repeatedly transmits message over a UART. These messages can be read in terminal application on a computer using a USB-to-serial adapter. By default, it uses the real-time core's dedicated UART, but if your hardware doesn't expose this UART's TX pin, then the sample can be altered to use a different UART.
To use this sample, clone the repository locally if you haven't already done so:
git clone --recursive https://github.com/Azure-Samples/Azure-RTOS-on-Azure-Sphere-Mediatek-MT3620
File/folder | Description |
---|---|
demo_threadx |
Sample source code. |
threadx |
Azure RTOS ThreadX source code (submodule). |
mt3620_m4_software |
MediaTek 3620 HAL (submodule). |
README.md |
This README file. |
-
Seeed MT3620 Development Kit or other hardware that implements the MT3620 Reference Development Board (RDB) design.
-
A USB-to-serial adapter (for example, FTDI Friend) to connect the real-time core UART to a USB port on your computer.
-
A terminal emulator (such as Telnet or Termite to display the output.
To prepare your device on Windows:
-
Right-click the Azure Sphere Developer Command Prompt shortcut and select More>Run as administrator.
The
--enable-rt-core-debugging
parameter requires administrator privilege because it installs USB drivers for the debugger. -
Enter the following azsphere command:
azsphere device enable-development --enable-rt-core-debugging
-
Close the window after the command completes because administrator privilege is no longer required. As a best practice, you should always use the lowest privilege that can accomplish a task.
To prepare your device on Linux:
-
Enter the following azsphere command:
azsphere device enable-development --enable-rt-core-debugging
You may need to update the OS by using if you have an older device.
azsphere device recover
To prepare your hardware to display output from the sample:
- Attach the USB-to-serial adapter to your PC.
For Seeed RDB
-
Connect GND on the USB-to-serial adapter to GND on your dev kit. On MT3620 RDB hardware, GND is Header 2, pin 2.
-
Connect RX on the USB-to-serial adapter to TXD0 on your dev kit. On MT3620 RDB hardware, TXD0 is Header 2, pin 3.
For Avnet Azure Sphere Starter Kit
-
Connect GND on the USB-to-serial adapter to GND on your dev kit. On Avnet Azure Sphere Starter Kit hardware, GND is Click Socket #1, Header 2, pin 8.
-
Connect RX on the USB-to-serial adapter to TXD0 on your dev kit. On Avnet Azure Sphere Starter Kit hardware, TXD0 is Click Socket #1, Header 2, pin 4.
For Windows:
-
Determine which COM port the adapter uses on the PC. If you're using the FTDI Friend adapter, start Device Manager, select View > Devices by container, and look for FT232R USB UART.
-
On the PC, start a terminal emulator and then open a 115200-8-N-1 terminal to the COM port used by the adapter.
For Linux:
-
Find out which port the serial device is connected to:
dmesg | grep ttyUSB
The port should be named ttyUSBn, where n indicates the port number.
-
Set up a terminal program to monitor the port. For example, the following commands set up Minicom to monitor port 5, but you can use any program you prefer:
sudo apt install minicom sudo minicom -D /dev/ttyUSB5 -b 115200
See tutorial to learn how to build and deploy this sample: Tutorial: Build a real-time capable application
Note: You need Azure Sphere SDK version >= 20.07 to build and run the sample.
The connected terminal emulator should display output from the demo_threadx
program. The program outputs the threads status incrementally:
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.