SimpleLink™ MCU SDKs: RTOS and POSIX

Welcome to the second installment in a series of blog posts that will review the major components of the SimpleLink™ microcontroller (MCU) platform’s software development kits (SDKs). These SDKs feature common components and device-specific middleware that speed time to market and provide a unified development experience across the entire SimpleLink MCU portfolio of wired and wireless devices. Refer to Figure 1 below for a block diagram of the SimpleLink SDK. In this post, I will dive deeper into how components included within the SimpleLink SDK enable you to create deterministic, efficient, scalable applications with a real-time operating system (RTOS).

Figure 1: SimpleLink SDK

TI-RTOS
The SimpleLink SDK is integrated with TI-RTOS, a full-featured real-time OS. All TI SimpleLink SDKs come with the TI-RTOS kernel pre-installed and are Portable Operating System Interface (POSIX)-compliant. TI-RTOS is a robust solution you can trust, already deployed in thousands of applications across various TI embedded solutions. The kernel is open source (Berkeley Software Distribution [BSD] license) and was developed in lockstep with TI’s silicon portfolio to enable very low latency in an efficient code footprint. TI-RTOS helps you optimize your applications for power consumption, performance and code size to meet your unique needs. Specifically, TI-RTOS’ power-management capabilities enable you to achieve aggressive power savings for your applications with minimal effort and intuitive application programming interfaces (APIs).

At the center of the TI-RTOS kernel is the scheduler, which ensures that the highest priority thread is running. This offers deterministic and fast operation. TI-RTOS supports four different types of threads: hardware interrupts (Hwis), Software interrupts (Swis), task and idle, shown in figure 2 below. TI-RTOS offers several thread-communication mechanisms such as semaphores, mailboxes, queues, gates and events. Furthermore, TI-RTOS includes system-level timing services and memory managers to ensure that your application is as efficient and lean as possible.

Figure 2: Types of threads supported in TI-RTOS

FreeRTOS
The SimpleLink SDK was developed to be modular, allowing you to use alternative RTOS kernels beyond TI-RTOS. In addition to TI-RTOS, the MSP432™ and Wi-Fi® CC3220 software development kits (SDKs) also include the ability to use the popular FreeRTOS. The modularity of SimpleLink SDKs make it easy for you to plug in your OS/kernel of preference for maximum flexibility.

POSIX
The SimpleLink SDK also offers POSIX-compatible APIs. POSIX is an Institute of Electrical and Electronics Engineers (IEEE) industry API standard for OS compatibility. The POSIX layer abstracts the RTOS kernel functionality used by applications. Requiring less than 2KB of code in typical applications, the POSIX layer enables the reuse and porting of examples and user applications to a different kernel. Using this layer is optional, but it means that you can use whatever OS you are currently familiar with or want to move to in the future. POSIX compatibility also allows TI third-party partners to interface with SimpleLink SDK devices to add support for their kernel, providing complete freedom to design with any OS, including FreeRTOS.

Runtime Object Viewer
To help you optimize your RTOS-enabled application, TI offers powerful tools to help you debug and monitor your code. Specifically, the Runtime Object Viewer (ROV2) offers a powerful visualization and instrumentation interface to help you monitor thread states, heap usage and central processing unit (CPU) load. Figure 3 below shows a few available dashboards to help you debug. While the ROV2 can provide helpful insight into your RTOS-enabled application, the ROV2 tool is flexible enough to display high-level information relevant to any library, RTOS or not, within your application.

Figure 3: Views available in Runtime Object Viewer utility

Explore more
To learn more about the SimpleLink MCU SDK, review the white paper, “Simplifying software development to maximize return on investment,” visit SimpleLink Academy or download the SDK and start coding immediately with CCS Cloud.

The next installment of this SimpleLink MCU SDK series will provide more insights on Bluetooth® low energy stacks.