Introduction
#
What is Stratify OSStratify OS is an application-based microcontroller operating system.
The Applications are:
- Built, installed, and managed separately from the OS
- Completely abstracted from the hardware (instruction set compatible)
- Memory protected (using ARM Cortex-M MPU) within the MCU address space
- Relocatable at load time
- built using a POSIX API
pthread
,mqueue
,semaphore
,sched
,unistd
,socket
info
If you want to try Stratify OS on a development board, visit our technical documentation.
#
When to use Stratify OS?#
ComplexityEmbedded systems vary from simple devices that flash LEDs to complex devices with displays and rich audio. Stratify OS works best with products addressing complex product requirements but not so complex that you need something like Android.
If you are on the border of medium and high complexity, it will come down to volume and development time. Stratify OS lets you save big on development time at the cost of slightly more RAM/flash usage.
If your product needs 2 or more of the following, Stratify OS might be the best option you have:
- SD Card with FAT Filesystem
- Encrypted Data Storage
- Wifi or Ethernet Internet Connectivity
- TLS Secure HTTP connections
- Playing Audio files from flash/SD Card
- Secure Remote Updates
- USB Bootloader
- Transfer files between your MCU and a computer over USB
- Graphical Display
- Capacitive Touch Screen
- Internal Data Logging
- Concurrent Programming (Threads/Mutexes/Semaphores/etc)
- Need to allow 3rd party developers to run code (like for a Wifi or Bluetooth module)
#
HardwareMinimal deployment
Stratify OS can be deployed on chips that have 256KB of program memory:
- 32KB USB Bootloader
- 128KB Kernel image (reduced C library where uncommon modules, like
math.h
andwchar.h
are omitted) - 96KB User Application/Data
Standard Deployment
Stratify OS is typically deployed on chips that have at least 512KB of program memory:
- 32KB USB Bootloader
- 256KB Kernel image (full C library)
- 224KB User Application/Data
Complex Deployment
More complex deployments that include graphics, TLS, JSON, and other libraries will vary in size and complexity. In these cases, the bootloader can run in internal flash memory while the kernel runs on external QSPI flash. The application might be stored on an SD card and then loaded to RAM (or internal flash) during run time. As an example, the Toolbox uses the following configuration:
- Cortex M7 CPU with instruction and data caches
- 128KB Internal flash runs a minimal Stratify OS deployment
- 8MB QSPI external flash runs
- 2MB of kernel image with LVGL graphics, mbedTLS, sockets, and JSON libraries
- 3MB of application binaries loaded to RAM at runtime
- 3MB of UI assets
- 1MB Internal RAM
- 256KB System memory
- 768KB for applications loaded from QSPI flash or the SD card
- Runs multiple applications at once such as GUI, webserver, and MCU flash protocols
- SD Card user-replaceable up to 32GB
- Stores user data and applications
With complex deployments, there is a lot of flexibility in how the system can be designed to balance the costs and performance constraints in the system.
Is Linux Overkill for your project?
If you are using embedded Linux and looking for ways to save on production hardware, a complex Stratify OS deployment might be just what you need.
#
CostsStratify OS is designed to save you development and maintenance costs but in some cases has a production cost penalty.
Development Costs
Stratify OS helps you save on development costs in two ways.
- System features are built-in and highly integrated freeing you up to invest in your application.
For example, Stratify OS has an integrated USB bootloader that works driver-free with Windows, Mac, and Linux. Other RTOS's leave the bootloader up to you.
- Division of labor between system firmware developers and applications developers
The IoT era has rushed in much more complex requirements for many embedded systems. Stratify OS provides an architecture to build on and lets you break down the complexity into a (1) kernel and (2) applications. Low-level firmware engineers can focus on kernel code (like device drivers, DMA, cache, etc) while software developers can build complex C or C++ applications.
Is your firmware behind schedule?
If you only have one or two firmware engineers building a complex embedded system and you aren't making the progress you want, we should talk. Stratify Labs can provide all of your system firmware needs allowing your full-time engineers to focus on developing your application.
Maintenance Costs
Stratify OS provides an advantage over most alternatives when it comes to maintenance costs. Because the kernel and applications are compiled and managed independently, bug fixes at the kernel level don't require the applications to be re-compiled. Plus, the applications can be quickly and easily updated without having to reflash the entire device.
Production Costs
Stratify OS is not highly optimized for binary size or RAM usage. This means you would probably be purchasing a microcontroller with more flash when compared to a lightweight RTOS or no RTOS. This penalty is most noticeable on minimal deployments where you would need an MCU with 256KB of flash. If your selected MCU has 512KB or more anyway, the cost penalty for using Stratify OS is minimal and only comes in to play when production volumes get very high.
#
How to use Stratify OSThe best way to start using Stratify OS is to install a pre-compiled binary on a supported development board. Stratify OS supports a few different development boards. You should select the one that best matches what you are trying to build.
Nucleo 144 Series
- USB Bootloader
- Prototyping Header
- SPI, UART, I2C, PWM Drivers
- Ethernet Connection with LWIP Sockets
STM32H750-DK
- Graphical Touch Display
- Ethernet Connectivity
- Audio Subsystems
- 1MB internal RAM, 128KB internal flash (runs the bootloader)
- XMB external SDRAM, XMB external QSPI Flash
- SD Card and EMMC dual-mounted FAT filesystems
If getting started on your own is too intimidating, maybe we can help. Stratify Labs provides services to companies that are working on Stratify OS-powered products.
To get started, you just need to install the pre-built Stratify OS binary and then you can immediately start working on your application.
- No need for any system-level firmware development
- hardware is all initialized before your application starts
The code below is a complete implementation of Hello, World on Stratify OS.
#include <cstdio>int main(int argc, char * argv[]){ printf("Hello World\n"); return 0;}
Drivers for the hardware (UART/SPI/I2C/I2S/LCD/etc) are pre-installed and ready to start using. They are accessed through the filesystem using the POSIX unistd
interface.
#include <cstdio>#include <sos/dev/uart.h>int main(int argc, char * argv[]){ int fd = open("/dev/uart", O_RDWR); //initializes UART with default attributes 115200,8,1,N ioctl(fd, I_UART_SETATTR, NULL); const char hello_world[] = "Hello World\n"; write(fd, hello_world, sizeof(hello_world)); close(fd); return 0;}