HN
Today

Show HN: TinyOS – A minimalist RTOS for Cortex-M written in C

TinyOS is an ultra-lightweight RTOS for resource-constrained IoT and embedded devices, written in C and featuring a kernel footprint under 10 KB with 2 KB minimum RAM. It boasts a comprehensive set of capabilities including preemptive scheduling, network stacks, file system, and an interactive shell, appealing to developers building efficient and feature-rich embedded applications.

13
Score
2
Comments
#3
Highest Rank
2h
on Front Page
First Seen
Apr 3, 10:00 PM
Last Seen
Apr 3, 11:00 PM
Rank Over Time
33

The Lowdown

TinyOS is a new, minimalist real-time operating system (RTOS) specifically designed for resource-constrained IoT and embedded devices. It is implemented in C and aims to provide a robust yet extremely lightweight foundation for complex embedded applications.

  • Core Features: The kernel offers preemptive priority-based scheduling with 256 levels, O(1) priority lookup, and priority inheritance. It includes comprehensive synchronization primitives like mutexes (with priority inheritance), semaphores, condition variables, event groups, and message queues.
  • Resource Efficiency: The kernel's footprint is less than 10 KB of ROM, and it requires a minimum of 2 KB of RAM, making it suitable for highly constrained hardware.
  • Advanced Modules: Beyond core OS functionalities, TinyOS integrates a sophisticated suite of features, including a lightweight block-device file system with wear leveling and power-fail safety, and a full network stack supporting Ethernet, IPv4, ICMP, UDP, TCP, HTTP client/server, and DNS.
  • Connectivity & Security: It provides full MQTT 3.1.1 and CoAP (RFC 7252 compliant) implementations for IoT communication, and supports TLS 1.2/1.3 and DTLS 1.2 via mbedTLS. Security features include MPU-based memory protection and secure boot support.
  • Utilities: An interactive VT100 shell offers 19 built-in commands, command history, and tab completion. It also includes software timers, fixed-block memory allocation, stack overflow detection, and a versatile power management system with idle/sleep/deep-sleep modes and tickless idle.
  • Hardware Support: Primarily targets ARM Cortex-M processors (M0/M0+/M3/M4/M7) found in STM32, nRF52, and Raspberry Pi Pico, with experimental support for RISC-V (RV32I) like ESP32-C3 and AVR (ATmega).
  • OTA Updates: Features A/B partition firmware updates with CRC32 verification and rollback capabilities.

TinyOS positions itself as a comprehensive yet incredibly compact RTOS solution, offering a wide array of modern embedded system functionalities from basic task management to secure networking, all within a small resource envelope, ideal for the next generation of IoT devices.