Fundamentals : Dependencies HAL <-> Kernel

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

Fundamentals : Dependencies HAL <-> Kernel

Postby rkuehn » Fri Apr 10, 2015 8:18 am

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: 12021
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 543 times
Been thanked: 455 times
Contact:

Re: Fundamentals : Dependencies HAL <-> Kernel

Postby Giovanni » Fri Apr 10, 2015 8:26 am

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 3013 times


Giovanni

aport
Posts: 29
Joined: Sat May 10, 2014 7:35 pm
Been thanked: 1 time

Re: Fundamentals : Dependencies HAL <-> Kernel

Postby aport » Fri Apr 10, 2015 11:05 pm

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

Postby clonephone82 » Tue Apr 28, 2015 11:57 am

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

Postby rkuehn » Tue Apr 28, 2015 4:48 pm

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: 12021
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 543 times
Been thanked: 455 times
Contact:

Re: Fundamentals : Dependencies HAL <-> Kernel

Postby Giovanni » Tue Apr 28, 2015 5:45 pm

It is because you are using the wrong OSAL.

The demo without RTOS is HAL-STM32F407-DISCOVERY.

Giovanni

aport
Posts: 29
Joined: Sat May 10, 2014 7:35 pm
Been thanked: 1 time

Re: Fundamentals : Dependencies HAL <-> Kernel

Postby aport » Thu Apr 30, 2015 3:47 am

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 147 times


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 1 guest