Synchron – An API and Runtime for Embedded Systems

05/06/2022
by   Abhiroop Sarkar, et al.
0

Programming embedded systems applications involve writing concurrent, event-driven and timing-aware programs. Traditionally, such programs are written in low-level machine-oriented programming languages like C or Assembly. We present an alternative by introducing Synchron, an API that offers high-level abstractions to the programmer while supporting the low-level infrastructure in an associated runtime system and one-time-effort drivers. Embedded systems applications exhibit the general characteristics of being (i) concurrent, (ii) I/O-bound and (iii) timing-aware. To address each of these concerns, the Synchron API consists of three components: (1) a Concurrent ML (CML) inspired message-passing concurrency model, (2) a message-passing–based I/O interface that translates between low-level interrupt based and memory-mapped peripherals, and (3) a timing operator, syncT, that marries CML's sync operator with timing windows inspired from the TinyTimber kernel. We implement the Synchron API as the bytecode instructions of a virtual machine called SynchronVM. SynchronVM hosts a Caml-inspired functional language as its frontend language, and the backend of the VM supports the STM32F4 and NRF52 microcontrollers, with RAM in the order of hundreds of kilobytes. We illustrate the expressiveness of the Synchron API by showing examples of expressing state machines commonly found in embedded systems. The timing functionality is demonstrated through a music programming exercise. Finally, we provide benchmarks on the response time, jitter rates, memory, and power usage of the SynchronVM.

READ FULL TEXT

page 23

page 27

page 35

page 36

page 38

research
08/17/2021

Higher-Order Concurrency for Microcontrollers

Programming microcontrollers involves low-level interfacing with hardwar...
research
11/10/2017

FunTAL: Reasonably Mixing a Functional Language with Assembly

We present FunTAL, the first multi-language system to formalize safe int...
research
11/02/2022

Fluent APIs in Functional Languages (full version)

Fluent API is an object-oriented pattern for elegant APIs and embedded D...
research
01/26/2023

Concrat: An Automatic C-to-Rust Lock API Translator for Concurrent Programs

Concurrent programs suffer from data races. To prevent data races, progr...
research
09/17/2020

A type language for message passing component-based systems

Component-based development is challenging in a distributed setting, for...
research
06/01/2017

A Concurrency-Agnostic Protocol for Multi-Paradigm Concurrent Debugging Tools

Today's complex software systems combine high-level concurrency models. ...
research
05/29/2019

TickTalk -- Timing API for Dynamically Federated Cyber-Physical Systems

Although timing and synchronization of a dynamically-changing set of ele...

Please sign up or login with your details

Forgot password? Click here to reset