Download presentation
Presentation is loading. Please wait.
Published byEric Cameron Modified over 10 years ago
1
Nick Lethaby, TI-RTOS and IoT Ecosystem May 2015
TI-RTOS overview Nick Lethaby, TI-RTOS and IoT Ecosystem May 2015 Introduce yourself as the speaker along with your title
2
Wi-Fi, Bluetooth® Smart, ZigBee®, Cellular (via PPP), Wired TCP/IP,
What is TI-RTOS? Connectivity Wi-Fi, Bluetooth® Smart, ZigBee®, Cellular (via PPP), Wired TCP/IP, TLS/SSL Other Middleware USB, File Systems TI-RTOS User Application Tasks APls Power Manager Real-time Kernel Drivers IoT MCU Sensors
3
TI-RTOS development tools
TI-RTOS works with the TI Code Composer Studio (CCS), IAR, and GCC toolchains The RTOS Object Viewer enables developers to study the state of OS objects such as tasks, stacks, and semaphores Available for CCS and IAR The RTOS Analyzer enables developers to look at execution history including context switching and per-task CPU load Available for CCS
4
How TI-RTOS helps developers
Provides pre-tested embedded software modules Connectivity protocols, power management, real-time kernel, … Eliminates need for these to be developed from scratch Enables developers to focus on their areas of application expertise No licensing hassles to use Completely free to use and deploy Reduced effort to port existing applications to new devices RTOS isolates application from hardware specifics Simpler development and maintenance of multi-function applications Using multiple priorities and threads to integrate different functions Add new features without modifying real-time response
5
TI-RTOS kernel, drivers, & power manager
Connectivity Wi-Fi, Bluetooth Smart, ZigBee, Cellular (via PPP), Wired TCP/IP, TLS/SSL Other Middleware USB, File Systems TI-RTOS User Application Tasks APls Power Manager Real-time Kernel Drivers IoT MCU Sensors
6
TI-RTOS kernel Designed for real-time applications
Scheduler is deterministic so kernel system calls complete operation in a predictable time Interrupt latency is low “Zero-latency Interrupts” enable kernel to be used in hard real-time applications Low footprint to meet MCU memory constraints Kernel is highly configurable so unneeded functions are excluded Static configuration enables very low footprints by eliminating need for heaps or create/delete calls if desired Tick suppression for enhanced low-power performance TI-RTOS Kernel is a true real-time kernel that has deterministic system calls to ensure real-time deadlines can be met. Because interrupt latency is of particular importance in real-time control applications, the amount of time for SYS/BIOS disables interrupts to modify critical data structures has been minimized. For applications that require even less, SYS/BIOS enables certain interrupts to occur with little or no latency at all (depending on the silicon architecture). These “zero-latency” interrupts cannot interact directly with the RTOS. Each release of SYS/BIOS has detailed timing and size benchmarks you can use to get the most optimized application. SYS/BIOS is very modular and scalable so that useful configurations can start as low as around 3 KB. For applications that just need a few tasks and other OS objects, developers can create these statically at build-time. This saves further on-chip memory by eliminating the need for create/delete calls in the embedded application and potentially eliminates the need for a heap (since dynamically created OS structures require a heap). All code interacting with the OS, including interrupt handlers, may be written in C or C++, eliminating the need for difficult to maintain assembly code in ISRs for example.
7
Kernel services IPC Services: Debug & Analysis:
Events, Mailboxes, Semaphores, Gates Debug & Analysis: Logging, diagnostics, Hooks, stack checking Device-specific services: Interrupt and power management, timers, exception handling Memory Managers: Heap, fixed-sized buffers TI-RTOS Kernel provides a broad range of real-time kernel services: Interrupts are handled by centralized dispatcher which perform low-level context save and restore operations, along with OS-specific operations such as enabling/disabling kernel preemption. This enables ISRs to be written in C. In addition, SYS/BIOS provides power management (for MSP430) and timer management, with additional HW-specific services on some devices, such as exceptions on ARM Cortex M devices. Threading: SYS/BIOS provides standard tasks for easy implementation of multitasking applications. In addition to tasks, SYS/BIOS provides ligthweight pre-emptible threads called Software Interrupts (SWIs), that cannot yield or pend. SWIs offer faster context switch times and require less RAM as they use a common system stack. Clock functions are time-triggered SWIs. The idle loop provides a place to either run very low-priority background threads or to place the MCU into a low-power mode. Interprocess Communication Services: Mailboxes provide fixed-sized message communication between tasks. There are counting semaphores and gates, which are used to managed shared access to resources or critical data structures. Events enable a task to wait on multiple combinations of semaphores, mailboxes, gates, or user-defined events. For memory management both a traditional heap, supporting variable-sized allocation is provided as well as fixed-sized buffer allocation, which provides faster, deterministic allocation. A further implementation called HeapMultiBuf provides variable-sized allocation using a heap of multiple fixed sized buffers pools. HeapMultiBuf provides variable-sized allocation that is deterministic. Unlike standard variable-sized head allocation implementations, such as malloc (), it’s performance does not degrade due to increasing fragmentation. For program instrumentation, logs provide a very low overhead print statement. Hook functions enable application-specific functions to be called when a task switch, creation, or deletion. Developers can use hook functions to add custom debug statements or custom context specific to their application. For ISAs that support them, such as ARM Cortex M, hardware-generated exceptions are caught and the context is saved. SYS/BIOS also offers stack size and overflow checking at runtime and parameter checking via asserts. Threading Services: Tasks, Software Interrupts, Clocks, Idle
8
An integrated approach to power management
Drivers & stacks: Request peripheral clocks and power domains be enabled Set power-down constraints in critical sections Power policy: Run in idle task Select power saving mode Clock module: Provide next scheduled event Power manager: Manage clock gates & power domains Power-down and wake-up routines Power-down and wake-up latencies Record power-down constraints
9
Impact of TI-RTOS power manager
TI MCU offers low power modes that consume exponentially less power compared to simply sleeping the main Cortex-M core (WaitForInterrupt) The default power policy uses the latency data combined with its knowledge of the next scheduled event to select the lowest possible power state, thus greatly extending battery life Note: The data below is from the SimpleLink™ CC2640 wireless MCU Power Mode Wake-up Time to CPU Active Current Used Active NA 4.145 mA WaitForInterrupt A few cycles 2.028 mA IDLE 1.4 µs 796 µA STANDBY 14 µs 1-2 µA
10
TI-RTOS device drivers & board support
Driver APIs are consistent across device families Makes applications easy to port to other device supported by TI-RTOS Drivers are designed for use with RTOS Thread-safe Block (on a semaphore) when waiting for I/O so CPU is released for another thread to run Each supported board has a “board.c” file that contains the code for initializing all the peripherals Drivers are “power-aware” for ultra low-power MCU devices Since developers commonly need driver source code for debugging boot or interrupt related issues or for optimizing the driver itself, we provide the source code for all drivers. The drivers themselves use the appropriate (e.g. Tivaware, MSPWare) peripheral software libraries as is, which ensure we can easily incorporate the latest library versions. TI-RTOS provides higher-level driver APIs that are consistent across all devices to simplify porting. Each peripheral class (e.g. UART or SPI) has its own set of standardized APIs. The driver implementations are designed to work with a task/semaphore model.
11
TI-RTOS device drivers
C28+M3 TM4C MSP432 MSP430 CC3200 CC26xx Real-time clock Y Timer UART DMA-based UART I2C I2S SPI SPI-SD PWM Camera EMAC USB Watchdog
12
TI-RTOS connectivity & middleware
Wi-Fi, Bluetooth® Smart, ZigBee®, Cellular (via PPP), Wired TCP/IP, TLS/SSL Other Middleware USB, File Systems TI-RTOS User Application Tasks APls Power Manager Real-time Kernel TI-RTOS 2.12 builds on earlier versions of TI-RTOS, which provided standard multitasking, driver, and middleware APIs across TI devices, by adding features that important to IoT endpoint developers. The connectivity stacks available on TI’s SimpleLink family of connected MCUs all work out of the box with TI-RTOS, giving developers access to Wi-Fi, Bluetooth Smart (Low Energy), and ZigBee. The TI-RTOS power manager, which we’ll discuss in more detail later, provides a set of power management services that can be accessed in a uniform manner across all of TI’s new low-power MCUs (SimpleLink CC26xx and CC3200, MSP432). Drivers IoT MCU Sensors
13
TI-RTOS: wireless connectivity
TI-RTOS supports all on-chips stacks in TI SimpleLink™ wireless MCUs out-of-box TI-RTOS supports the SimpleLink™ Wi-Fi CC3100 wireless network processor out-of-box Device Wireless Stack Comments CC3200 Wi-Fi CC3200 Wi-Fi host driver pre-tested on TI-RTOS CC2630 ZigBee Stack runs by default on TI-RTOS CC2640 Bluetooth Smart MCU + CC3100 TI-RTOS offers pre-integrated CC3100 host drivers using SPIs on MSP430, MSP432 and TM4Cx Speak to how the first three are Wireless MCUs
14
Standard BSD Sockets Interface Hardware Adaptation Layer
TI-RTOS TCP/IP stack T L S S N T P H T T P T F T P T E L N E T D N S D H C P TCP/IP Key Features Supports both IPv4 and IPv6 Standard BSD Sockets interface Zero-copy sockets interface available Highly configurable to meet footprint constraints PPP/Serial Interface allows use with third-party cellular modems SSL/TLS requires a licensing fee Standard BSD Sockets Interface TCP UDP ICMP IGMP Route Manager IP IF Manager PPP ARP NAT Serial IF Ethernet IF The TI-RTOS TCP/IP stack is highly modular. TI-RTOS comes with different pre-built binaries, so that the configuration tool can select the most compact one for the options selected. Both IPv4 and IPv6 are supported in the core stack. ROM space can be saved by eliminating IPv6, TCP, or various networking applications such as HTTP or DNS. In addition to being modular to reduce code size, the stack buffers are configurable, enabling developers to reduce these and save significant amounts of RAM if memory constraints are a bigger issue than maximizing network throughput. A variety of different APIs are provide. Standard BSD sockets make it easy to port existing network applications to the stack. Zero-copy and raw Ethernet APIs are available if higher performance is needed. At the application level, the stack provides several common networking applications, like HTTP and DHCP. Users can add their own applications, on top of the standard Berkeley sockets. Hardware Adaptation Layer Ethernet Packet Driver Serial Port Driver Timer Driver User LED Driver Hardware
15
Hardware Adaptation Layer
USB stack Class Driver Application M S C H I D C D H I D C O N F I G U R A T USB Key Features MSC Host Class Driver HID Host & Device Class Drivers CDC Device Class Driver Examples for each class driver Example of using MSC Host Driver under FAT file system Host Device Hardware Adaptation Layer SD card, mouse, UART, …. Drivers DMA Driver USB Driver The TI-RTOS USB stack offers both Host and Device capability, as well as OTG. In addition to the core stack, common class drivers are available. These include MSC Host, CDC Device, and HID Class Drivers. For HID, we provide HID keyboard Host and Device class drivers and HID mouse Host and Device class drivers. The stack is modular enabling developers to link-in only the modules they require and minimize memory requirements. Hardware
16
File system TI uses an open source software called FatFs Key features:
Both native and C RTS file APIs may be used C RTS APIs (fopen (), fread (), fwrite (), …) are plugged into file system Supports FAT12, FAT16, FAT32, and VFAT Long file names (VFAT) are not supported in the default build TI does NOT indemnify against VFAT patents Drivers options: SD Card (via SPI driver) USB flash drive (via USB MSC host) The TI-RTOS file system is a FAT-compatible file system that is an open source program called FatFS. Please note that this program uses a BSD-style license so there is no problem with “contamination” of proprietary programs as is possible with the GPL license used by Linux. A FAT-compatible file system enables an embedded application to create a file system that can be read by Windows PCs or any other system that supports a FAT file system. As discussed earlier, TI-RTOS include two different drivers: SD card via a SPI interface or via the USB stack and MSC host class driver and read/write to USB flash drives. Developers can call the file system using its native APIs or via the C Run-time system file I/O functions. It is important to note that the default build of FatFS used with TI-RTOS does not support long filenames. Long file names (VFAT) are subject to a Microsoft patent. FatFS can be rebuilt to support long filenames but the end-user is responsible for ensuring their compliance with use of Microsoft’s patents. TI does not indemnify users against these. This is a universal issue with any FAT-compatible file system.
17
Summary TI-RTOS enables developers to focus on their specific areas of applications expertise by providing pre-tested software building blocks: Multitasking kernel and device drivers Connectivity solutions: TCP/IP, Wi-Fi, BLE, and USB Advanced, easy-to-use power management Preemptive multitasking design paradigm simplifies development and maintenance of embedded applications TI-RTOS no-cost licensing removes commercial barriers to deployment
18
For more information www.ti.com web page: www.ti.com/tool/ti-rtos
Product brochure, white paper, manuals, software downloads e2e forum: Wiki: Select ‘TI-RTOS’ category Download page: Product manager: Nick Lethaby
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.