We had a great office hour session on June 5th, with Daniel King, Fernando Olea, Maxim Reznik, Vadim Godunko, Etiuenne Coulouma, Goncalo Caselhos, Olivier Henley, Alejandro R. Mosteo and Ibrahim Sory Diallo in attendance.
It was a nice share on experiences with device drivers. After the initial welcome Olivier started a discussion on his new generic device driver model. He is working with a lot of academic users of Ada that are building Capstone projects on embedded hardware.
He extensively uses generics in his device model. In other words, he creates a generic I2C driver that can then be implemented for the specific I2C driver for a device and then used in specific SoCs, that can then be used in specific boards (such as the ST Micro F4 series). Olivier favours this approach over the current HAL approach as it allows him more flexibility and he does not have to bring in the entire HAL.
The HAL approach will work very well for bareboard HAL crates, but may fall appart in larger Zephyr type applications with a lot more device access.
Lots of discussion on the topic, it would seem that his approach could nicely fit underneath the current HAL model, certainly something to try.
There was some discussion on generics including some additional code and some concerns about runtime performance, as always happens in embedded scenarios.
We also spent some time explaining what a runtime really is and what separates the runtime from an actual HAL. The runtime really is the bare minimum required to get programs running on a board. Think interrupt handler, memory setup, those types of things. It is generally more processor architecture related with slight modifications for different SoC and boards. The HAL handles devices such as I2C, SPI, USB, you name it.
It was a lively discussion and I certainly learned quite a bit, as did many of the community participants.
The next Office Hours will be on June 19th. Details here: Ada SPARK Office Hours | AdaCore
One of the topics I want to suggest for that discussion is how people are using AI with Ada and SPARK, also based on @Irvise 's post on the Forum as a reply to the topic How to easily use AI Skills with your Ada projects - #9 by Irvise