Page 1 of 2

HAL demo without RTOS

Posted: Thu Mar 26, 2015 3:14 pm
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

Re: HAL demo without RTOS

Posted: Fri Mar 27, 2015 1:47 pm
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.

Re: HAL demo without RTOS

Posted: Fri Mar 27, 2015 1:59 pm
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 9068 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

Re: HAL demo without RTOS

Posted: Wed May 13, 2015 1:53 pm
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.

Re: HAL demo without RTOS

Posted: Wed May 13, 2015 2:39 pm
by Giovanni
Hi,

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

Giovanni

Re: HAL demo without RTOS

Posted: Sun Aug 30, 2015 2:37 pm
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.

Re: HAL demo without RTOS

Posted: Sun Aug 30, 2015 3:26 pm
by Giovanni
Hi,

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

Giovanni

Re: HAL demo without RTOS

Posted: Sun Aug 30, 2015 4:40 pm
by Giovanni
An immediate workaround is to compile with -O0 in the Makefile.

Giovanni

Re: HAL demo without RTOS

Posted: Sun Aug 30, 2015 4:52 pm
by nuft
Great, thanks for the fast reply!

Re: HAL demo without RTOS

Posted: Wed Jun 08, 2016 11:28 am
by Exeland
Can I use a USB HAL without an RTOS?