Re: HALs in Zephyr (was Re: STM32Cube SDK in Zephyr)


Daniel Thompson <daniel.thompson@...>
 

On 14/11/16 10:04, Fabien Parent wrote:
Hi Amit,

On Tue, Nov 8, 2016 at 8:51 AM, Amit Kucheria
<amit.kucheria(a)verdurent.com> wrote:
Hi Erwan,

On Thu, Nov 3, 2016 at 8:07 PM, Erwan Gouriou <erwan.gouriou(a)linaro.org> wrote:
Hi all,


There are growing number of STM32 based boards being ported in Zephyr
by the community. As part of ST, I can say that we are pleased to contribute
this way to Zephyr impact in IoT world.

In order to ease porting of STM32 devices, we'd like to introduce STM32Cube
SDK into Zephyr. Aim is to make porting fast and easy thanks to ST CSMIS
files, reduce code duplication and provide mature software with STM32Cube
adaptation layers (HAL and LL).
I'm all for allowing Zephyr to quickly add support for as much
hardware as possible and if HALs are the way to do it, then so be it.

However, I'd like to hear from Zephyr maintainers on whether this is
just a short-term strategy to get broad hardware support or the long
term goal because HALs do make for hard-to-read code[1] and each
vendor's HAL is different leading to further maintenance issues.

I ask this coming from a Linux development mindset where HALs are
actively discouraged.
I'm also interested in this topic.
You can count me as interested here as well.

On the one hand, with the advent of OS projects like Zephyr the MCU
vendors are starting to release their HALs as open source (i.e. they are
no longer adding a "don't port this driver to anyone else's silicon"
clause). For me this is a great step forward for small open source OSs
which, in turn, makes working on MCU projects much more comfortable for me.

On the other hand, like others, I've internalized the Linux project's
strong distaste for non-native drivers due to the long term maintenance
challenges it presents. From a Zephyr project PoV I think that having a
"good" driver set is what really drives the choice between one OS and
another, where "good" is a function both driver breadth (how many
drivers there are) and driver quality (how painful it is to enhance
drivers).

Hence the question about whether HALs are a short term means to get
driver breadth quickly (i.e. similar to the contiki network stack) or a
long term means to avoid Zephyr becoming a "driver project".


Daniel.

Join devel@lists.zephyrproject.org to automatically receive all group messages.