Use UARTs in real-time capable applications

Important

This is the Azure Sphere (Legacy) documentation. Azure Sphere (Legacy) is retiring on 27 September 2027, and users must migrate to Azure Sphere (Integrated) by this time. Use the Version selector located above the TOC to view the Azure Sphere (Integrated) documentation.

The ISU UARTs on the Azure Sphere device are available for use by RTApps. To use an ISU UART, an RTApp must list it in the Capabilities section of the application manifest. Identify the UART by using the "AppManifestValue" that is defined for it in the JSON file for the target chip. For example, the following line reserves the UART on ISU0 on an MT3620 chip:

"Capabilities": {
   "Uart": [ "ISU0" ]
  }

Your application code needs a way to identify the UART, its register base address, and its interrupt number, and must include an interrupt handler for the UART. You can find the base address and interrupt number for the UART in the manufacturer's hardware documentation.

Note

The Azure Sphere OS does not reset peripherals on start-up. Your applications should ensure that peripherals are in a known-good state on start-up or after restart.

MT3620 support for UARTs on the real-time cores

This section describes the UART options that apply for real-time cores on MT3620 hardware. For general information about MT3620 support for UARTs, see MT3620 support.

Each real-time core has a dedicated UART, which is separate from the ISU UARTs and is intended for logging. Because each such UART is dedicated for use only by the application on its core, the RTApp is not required to list it in the application manifest. RTApps are assigned to the first real-time core that is available; it is not currently possible to choose which real-time core—and thus which dedicated UART—an application uses. However, the output of the azsphere device app start command reports which core has been assigned to the application.

For register base addresses, interrupt numbers, clock rate, sampling frequency, and other details about the MT3620, see the MT3620 Datasheet and the MT3620 M4 User Manual; if questions remain, you can request details from Avnet by emailing Azure.Sphere@avnet.com.

The UART sample application

The UART_RTApp_MT3620_BareMetal sample demonstrates how to communicate over the UART in an RTApp.