HAL demo without RTOS

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

HAL demo without RTOS

Post by Giovanni »

Hi,

I added in 3.0 a demo of HAL without RTOS in order to demonstrate the capability, those interested look the demo: HAL-STM32F407-DISCOVERY

Giovanni
User avatar
barthess
Posts: 861
Joined: Wed Dec 08, 2010 7:55 pm
Been thanked: 7 times

Re: HAL demo without RTOS

Post by barthess »

Could you provide some more details about using HAL without OS?
Would be good to have article about it on the official site.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: HAL demo without RTOS

Post by Giovanni »

The HAL now does no more use the RT API directly, it calls a reduced API defined in a new layer called OSAL.

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


The functions in this OSAL layer map 1 to 1 with normal RT and NIL API so there is no overhead using our RTOSes, the new architecture allows to write OSALs for other RTOSes and also bare metal machines.

I don't plan to write OSALs for other RTOSes but this can be done, there is already a running example of this created by a 3rd party.

Under /os/hal/osal/os-less/ARMCMx now there is an OS-less OSAL running on top of just CMSIS and that is what that demo uses. Basically you have all the HAL and OSAL API for your application but no threading, enough for a lot of applications and no GPL code inside.

An article about the OSAL is a good idea, this is something that a lot of other project got totally WRONG, time will tell if our implementation is a good compromise.

Giovanni
Zak Mc Kraken
Posts: 1
Joined: Wed May 13, 2015 1:42 pm

Re: HAL demo without RTOS

Post by Zak Mc Kraken »

Hi,
That's what i was looking for. Use only the HAL of ChibiOS but whitout the OS. Is this feature only in 3.0 ?
I'm using version 2.6.8 and was wondering if i do not call chSysInit() but only halInit() in my main function i have the same behaviour ? But i guess it 's not as simple.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: HAL demo without RTOS

Post by Giovanni »

Hi,

No, this is specific of 3.0, most of the work went into decoupling the components.

Giovanni
nuft
Posts: 3
Joined: Tue Mar 03, 2015 4:55 pm

Re: HAL demo without RTOS

Post by nuft »

Hi,
I tested the OS-less HAL demo application on my F4Discovery.
After about 20 seconds, the application hangs forever in osalThreadSuspendS(). Apparently, it doesn't get waked up from the threads queue.
The problem is probably either in the OSAL port or in hal_queues.
I am using ChibiOS 3.0.1 stable release.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: HAL demo without RTOS

Post by Giovanni »

Hi,

I have been able to reproduce the problem, will be fixed for 3.0.2.

Giovanni
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: HAL demo without RTOS

Post by Giovanni »

An immediate workaround is to compile with -O0 in the Makefile.

Giovanni
nuft
Posts: 3
Joined: Tue Mar 03, 2015 4:55 pm

Re: HAL demo without RTOS

Post by nuft »

Great, thanks for the fast reply!
Exeland
Posts: 12
Joined: Sat Jun 06, 2015 4:33 pm

Re: HAL demo without RTOS

Post by Exeland »

Can I use a USB HAL without an RTOS?
Post Reply