Go Down

Topic: FreeRTOS for Due, Teensy 3.0 and AVR Arduinos (Read 7467 times) previous topic - next topic


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. 



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 Gray aka the GRAYnomad www.robgray.com


You can totally takeover the SysTick interrupt.  The plan is to have a weak symbol for
Code: [Select]

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.


Rob Gray aka the GRAYnomad www.robgray.com

Go Up