Ada Embedded
STM32F4 Discovery Kit edition
1 Motivation
This project is a follow on to the earlier adaskills book. The book was taking baby steps in applying Ada to complex problems. By no means was it complete leaving many interesting features unexplored. Efforts are underway to revise the book and make it more comprehensive.
A particular gap in coverage was embedded systems loosely interpreted here as microcontroller based systems - potentially bare metal or perhaps with other RTOSes. This project is an attempt to fill that gap.
By nature, embedded systems are resource constrained and time sensitive. They are real time systems sometimes with hard real time requirements and constraints. Typical applications tend to be safety critical and require high reliability over essentially forever. Ada is a natural fit for such applications and has been used in many such applications over the years.
My own interest in this area started in the mid 80s when I was fortunate to be part of the team involved in designing a complex and large steel mill control system. The previous design built with Fortran was ripe for revision and we were given the opportunity to design a new system from scratch. The team chose Ada and an RTOS as the target platform collaborating with a supervisory layer that benefited from a conventional general purpose operating system. The system grew to be the first major non defense application comprising more than half a million lines of code. It was deemed a success and continued to control steel mills for many years.
1.1 Hardware
The nostalgia of those days is rekindled these days with the availability of powerful microcontrollers and the ability to run Ada on them. The prohibitive cost of the development platform is no longer a barrier for hobbyists and learners. This book is an attempt to explore the use of Ada in practical embedded applications. While there are many potential microcontroller platforms, the STM32F4 Discovery board is a good choice for learning and experimentation. It is widely available, affordable, and has a rich set of features that make it suitable for a variety of applications. My own toolchest contained an STM32F4 discovery board from several years ago and Ada was supported on it.
1.2 Software Library
The software library available Ada Drivers Library is rich and supports many microcontrollers besides the STM32F4. The intent is to build another layer on top of the ADL to enable us to develop full fledged applications with ease. Based on the experience of many years of developing medical devices, there are always a core set of features that teams spend a considerable effort building and maintaining. These include a command line interface, logging, reliable data communications and so on. The intent is to build a reusable library that provides these features and more on top of the ADL.