[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] Real Time Paparazzi with ChibiOS/RT

From: Alexandre Bustico
Subject: Re: [Paparazzi-devel] Real Time Paparazzi with ChibiOS/RT
Date: Thu, 10 Oct 2013 15:40:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

Le 10/10/2013 15:10, Felix Ruess a écrit :

I think that keeping the Paparazzi HAL (i2c, spi, etc. in mcu_periph) is a good way to go, so we can have the same peripheral drivers regardless of whether one is running "bare metal" paparazzi or with chibios. And features like the I2C and SPI transaction queues are not available in the chibios HAL if I'm not mistaken.

Which approach will end up to be the better one, writing a translation/glue layer between Papaprazzi and ChibiOS HAL or only using the ChibiOS scheduler (with maybe some select drivers like SDIO) and re-using our current arch drivers is probably impossible to answer until it has been tried...

We also at enac have a branch using chibios as RTOS on the apogee, and a mix of opencm3 (spi, uart, adc, i2c, timer) and chibios (sdio, usb storage) hal. After getting some headache to make
chibios and opencm3 cohabit, it's finally working, but real sd logging has still to be implemented and tested, hopefully in the beginning of November.

The idea behind using both chibios and opencm3 was we were thinking that it would be the fastest way to have high speed logging for our need in ppaparazzi, with the
robustness of the well tested peripheral drivers.

Now, I am not advocating  this solution in the long term, for cleaner code, I would prefer to eventually use chibios HAL through pprz HAL, so the both approach make sense,
our for the near future, and chibios only when it will be ready.

To get the full potential of RT system, the monolithic Paparazzi application had to be split into more individual threads. Threads are effectively replacing periodic function and events. That is probably the biggest change.

The "tasks" we currently have in main.c (using the virtual sys_time timers) were intended to be converted to real tasks/threads for an RTOS.
I don't know enough about ChibiOS yet to say whether it actually makes sense to create separate threads for e.g. telemetry tx and rx.

The rewards are control over task timing and priorities,


and hardware independence for Paparazzi.

Hm.. not that much more than what we have now...
Beware that the ChibiOS HAL does not support e.g. I2C, Uart, ADC for our LPC based boards... (And of course it won't help for systems like the ARDrone which essentially run on a full Linux).
But (at least for me) the HAL is not the reason for choosing an RTOS.

Task management and HAL are highly coupled in the case of chibios since RTOS and HAL share a same "event" scheme, so
using chibios HAL with chibios is easier and more natural than using opencm3 which is not a lot more
than macro and function which give registers access.

As written in the pull request, please always base new development like this on the master branch and add chibios as a submodule (e.g. like here)

We are using 2.6 branch too, so l would add simplicity if both pprz/chibios branches share the same chibios submodule.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]