Abstract timers and their implementation onto the ARM Cortex-M family of MCUs

Real-Time For the Masses (RTFM) is a set of languages and tools being developed to facilitate embedded software development and provide highly efficient implementations geared to static verification. The RTFM-kernel is an architecture designed to provide highly efficient and predicable Stack Resource Policy based scheduling, targeting bare metal (single-core) platforms. We contribute by introducing a platform independent timer abstraction that relies on existing RTFM-kernel primitives. We develop two alternative implementations for the ARM Cortex-M family of MCUs: a generic implementation, using the ARM defined SysTick/DWT hardware; and a target specific implementation, using the match compare/free running timers. While sacrificing generality, the latter is more flexible and may reduce overall overhead. Invariants for correctness are presented, and methods to static and run-time verification are discussed. Overhead is bound and characterized. In both cases the critical section from release time to dispatch is less than 2us on a 100MHz MCU. Queue and timer mechanisms are directly implemented in the RTFM-core language (-core in the following) and can be included in system-wide scheduling analysis.

[1]  Edward A. Lee The problem with threads , 2006, Computer.

[2]  Adam Dunkels,et al.  Contiki - a lightweight and flexible operating system for tiny networked sensors , 2004, 29th Annual IEEE International Conference on Local Computer Networks.

[3]  Rance Cleaveland,et al.  High-confidence medical device software and systems , 2006, Computer.

[4]  References , 1971 .

[5]  David E. Culler,et al.  TinyOS: An Operating System for Sensor Networks , 2005, Ambient Intelligence.

[6]  Theodore P. Baker,et al.  A stack-based resource allocation policy for realtime processes , 1990, [1990] Proceedings 11th Real-Time Systems Symposium.

[7]  Valeriy Vyatkin,et al.  A real-time semantics for the IEC 61499 standard , 2015, 2015 IEEE 20th Conference on Emerging Technologies & Factory Automation (ETFA).

[8]  Per Lindgren,et al.  Real-time for the masses, step 1: Programming API and static priority SRP kernel primitives , 2013, 2013 8th IEEE International Symposium on Industrial Embedded Systems (SIES).

[9]  Erez Petrank,et al.  A methodology for creating fast wait-free data structures , 2012, PPoPP '12.

[10]  Per Lindgren,et al.  RTFM-core: Language and implementation , 2015, 2015 IEEE 10th Conference on Industrial Electronics and Applications (ICIEA).