FreeRTOS for Due, Teensy 3.0 and AVR Arduinos

I have posted version 7.3.0 of FreeRTOS as FreeRTOSBeta20121215.zip http://code.google.com/p/beta-lib/downloads/list. A number of examples are included.

FreeRTOS is very popular and good documentation is available http://www.freertos.org/.

FreeRTOS supports cooperative scheduling but I like ChibiOS/RT a little better in cooperative mode so I have not provided an example of this mode. ChibiOS/RT is also posted as ChibiOSBeta20121212.zip and has a coop example.

A small patch is required to run FreeRTOS on Due. This patch involves a hook for access to the Cortex M SysTick interrupt. Future versions of the Arduino IDE should have this hook. I included the patched version of wiring.c for 1.5.1r2.

I have packaged FreeRTOS as two libraries, FreeRTOS_AVR and FreeRTOS_ARM. It would have been possible to combine these into one library but that would require a lot of modification to combine of the original FreeRTOS files with conditional compilation.

Thanks a bunch :slight_smile:

Yes thanks fat16lib, I have no immediate use for this but can see it in my future.

Do you know if they are limiting the hook into SysTick to a single user callback? That was the gist of a thread a while back but it's very limiting and I thought there may have been a change of heart.


Rob

You can totally takeover the SysTick interrupt. The plan is to have a weak symbol for

int SysTickHook();

This function is called before the Arduino part and will only execute the Arduino code if you return zero.

This doesn't solve the problem of two libraries wanting direct access to SysTick but that is what RTOSs should do.

OK, thanks.


Rob