Fundamentals : Dependencies HAL <-> Kernel

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Post Reply
rkuehn
Posts: 2
Joined: Thu Apr 09, 2015 1:24 pm

Fundamentals : Dependencies HAL <-> Kernel

Post by rkuehn »

We're migrating to a new controller family (STM32 M3 & M4) and are looking for a HAL for our framework. For reasons of certification we need to stick with our in-house/custom kernel.

I understand that according to the ChibiOS documentation the Kernel with its port is standalone with no dependencies to HAL ect.
However according to the dependencies diagram in the "ChibiOS/RT General Architecture" doc there are dependencies of the HAL and the Platform on the Kernel.

What are these dependencies? Can the ChibiOS HAL be used without the ChibiOS Kernel ?

thanks
Rolf
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by Giovanni »

Hi,

In version 3.0 the HAL has bee made independent from the kernel, it uses an intermediate layer called OSAL.

So far there are implementations for 3 different RTOSes and OS-less CMSIS. We do not guarantee implementability of the OSAL on any possible RTOS out there, the OSAL exists because we have two distinct RTOSes (RT and NIL) and we need to support both with the HAL.

architecture.png
architecture.png (25.3 KiB) Viewed 7638 times


Giovanni
aport
Posts: 36
Joined: Sat May 10, 2014 7:35 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by aport »

I can confirm that the HAL works with a third-party RTOS.
I've implemented an osal for FreeRTOS which, though not complete (I still need to do the thread reference queue implementation), has allowed me to use most of the HAL drivers. With the addition of the osal thread reference queue functions, all drivers should work.

ChibiOS/HAL has an excellent architecture.
clonephone82
Posts: 1
Joined: Tue Apr 28, 2015 11:53 am

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by clonephone82 »

Hi Aport,

Do you have any plans to share your FreeRTOS Port?

Thanks,

Regards
mathias
rkuehn
Posts: 2
Joined: Thu Apr 09, 2015 1:24 pm

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by rkuehn »

OK, but what if I wish to use the HAL without an RTOS. The dependancies between HAL and the non existing Kernel seem to be a problem.
e.g. the HAL's OSAL includes ch.h from the Kernel. I have not been able to remove the Kernel without making modifications in the HAL source.

Is the HAL truely independant of the Kernel in version 3.0 or have the dependancies just been standardiesed by the OSAL?
Giovanni also mentioned a RTOSless CMSIS implementaion. Where can I find it to take a look and give it a try.
Thanks
ROlf
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by Giovanni »

It is because you are using the wrong OSAL.

The demo without RTOS is HAL-STM32F407-DISCOVERY.

Giovanni
aport
Posts: 36
Joined: Sat May 10, 2014 7:35 pm
Has thanked: 2 times
Been thanked: 4 times

Re: Fundamentals : Dependencies HAL <-> Kernel

Post by aport »

clonephone82 wrote:Hi Aport,

Do you have any plans to share your FreeRTOS Port?

Thanks,

Regards
mathias


Hi, I've attached it here. Please note that it is not complete, however it does work for some drivers like I2C.
It depends on the latest FreeRTOS since it uses task events to facilitate the message passing that ChibiOS HAL relies upon. You can not use task events in your application or it will break things in the HAL.

Anything using threads_queue_t will not work since it is not implemented.

Have fun,
aport
Attachments
osal.zip
(7.3 KiB) Downloaded 1792 times
Post Reply