Porting Stratify OS to a new MCU Family


Stratify OS is an operating system specifically designed for the ARM Cortex-M architecture. It supports the following architectures:

  • ARM Cortex M3 (armv7m)
  • ARM Cortex M4 (armv7em)
  • ARM Cortex M4F (armv7em_f4sh)
  • ARM Cortex M7 (armv7em_f5sh and armv7em_f5dh)

There is planned support for the ARM Cortex M23 and M33 architectures though no chips are currently supported.

There are two major libraries that are included when building Stratify OS.

  • Stratify OS
  • Stratify MCU

The Stratify API library is strictly for building applications. Applications are not built with the OS like most microcontroller operating systems so there is nothing that needs to be done with Stratify API when porting.

The Stratify OS library requires minor modifications to the mcu/arch.h file to add the appropriate preprocessor definitions for the new chip family. Other than that, no changes to the Stratify OS codebase are required when porting to a new MCU family.

The Stratify MCU library is contains the vast majority of MCU specific code. There is a library for each chip family that is supported. Here are two examples:

The Stratify MCU library contains all the MCU specific startup code and peripheral drivers that are required to run Stratify OS on the chip.

Minimal Implementation

Stratify OS can run on an MCU if the following modules are implemented in the MCU library.

  • startup: defines MCU startup vectors
  • core: defines driver to access core MCU functionality
  • pio: defines driver to control a single LED
  • tmr: defines a driver with a 32-bit hardware timers used for usleep() and other system timing.
  • uart: defines a driver that can be used for debugging and to run the link protocol if USB is not ready

Standard Implementation

An MCU family is considered fully supported if it implements the following driver interfaces.

With the above drivers, the root filesystem, device filesystem, and application filesystem will all function correctly.

Extended Implementation

Support for an MCU family may be extended to support the following driver interfaces defined by Stratify OS.

Beyond Stratify MCU

Drivers whose functionality is fixed by the hardware should be implemented at the OS package level and do not need to be accessible by applications through the device filesystem. Examples of such drivers include external memory chips that are mapped to address space, memory mapped LCD drivers, etc.