Llosa de Viango Tollos – a supervisor



Getting started



  Tollos libraries

  Device libraries





  Sample application


mbed and Primer2  (click to enlarge)

mbed and Primer2  (click to enlarge)

Tollos is a small supervisor program for microcontrollers using ARM Cortex M3 cores. It is intended to provide an efficient platform for low power applications, suitable for development boards and microcontrollers from multiple vendors. It is written entirely in C.

The intent is to provide robust code that provides base functionality without specific device and board dependencies, so that a fast start can be made using a variety of boards, peripheral devices, and ARM Cortex processors. To this end, a number of features are included to get applications up and running and to simplify their development.

Simple peripherals can be manipulated using only the Tollos libraries (see the sample application), and for more sophisticated applications code can call device functions directly, using Tollos source code as a model or as a basis for extension.

The picture above shows an mbed board (which uses an LPC1768 microcontroller) and a Primer2 board (which uses an STM32F103VE microcontroller) both running Tollos and sharing an accelerometer (ADXL345) on an I2C bus.

The getting started page suggests some steps to follow to start using Tollos.

Tollos concepts

The general structure of an application comprises the application code iself together with libraries which are in two logical layers. The structure of an application is therefore:

1. Application program (such as the sample application).
2. Tollos libraries – these expose no direct board- or device-dependencies. Tollos carries out C initialization, sets the processor clocks, prepares interrupt handlers, and then runs your application functions, which are:
  • the init() function, which is called once if present
  • the tick() function, which is then called 25 times a second (by default) if present.

Various modules are included for LED, bit, bit interrupt, I2C bus, timing, UART, and watchdog control, and for debugging (characters to and from a terminal).

Accelerometer and Gyroscope generic device interfaces are included, as is a graphics drawing package for LCD displays, etc. Other modules (decimal arithmetic, GPS, etc.) are under development.

3. Device libraries – device libraries provide the low-level interface functions that are the ‘glue’ between a Tollos module (e.g., tollosBit) and a peripheral device, which might be
  • in a microcontroller
  • part of a development board (for example the LEDs on an mbed board)
  • an add-on device (such as an accelerometer).

In the case of microcontroller devices, Tollos provides the device-independent functions for access to UARTs, GPIO, I2C, etc., and also link scripts.

The glue functions in turn may use manufacturer-supplied drivers and definitions for some devices; C code here is unchanged from that supplied by the manufacturer, and is always identified by being placed in a subdirectory of the device library named public.

An application is built for a particular platform by linking the application object code with

  • the Tollos core library (tollos.a)
  • the libraries for specific devices used (e.g., lpc17xx.a for the LPC1768 microcontroller, mbed.a for the mbed board, and ADXL345.a for an accelerometer).

For information on where to find the libraries, see the directory structure page, and for more information on the design of Tollos, see the Design FAQ. Tollos code (except manufacturer’s code) follows fairly strict code conventions.


Tollos was originally written in the summer of 2010 by Mike Cowlishaw for the STM32-103STK development board from Olimex (which uses an STM32 microcontroller). This is used as an experimental avionics device.

The core of the supervisor was then generalized in late 2010 for the mbed board from NXP (which uses an NXP LPC1768 microcontroller) and for the Primer2 board from Raisonance and STMicroelectronics. It is intended to use these for breadboarding new avionics and navigation prototypes.


Many thanks to Chuck McManis and Eric Smith for their helpful feedback.

Tollos and these web pages were written by Mike Cowlishaw; Please send me any corrections, suggestions, etc.
All content © Mike Cowlishaw, 2010–2012, except where marked otherwise. All rights reserved. The pages here are for non-commercial use only (see the separate licence for Tollos source code). Privacy policy: the Speleotrove website records no personal information and sets no ‘cookies’. However, statistics, etc. might be recorded by the web hosting service.

This page was last updated on 2012-01-13 by mfc.