Pages: [1]   Go Down
Author Topic: FreeRTOS for Due, Teensy 3.0 and AVR Arduinos  (Read 2440 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. 


Logged

NZ
Offline Offline
Jr. Member
**
Karma: 1
Posts: 84
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a bunch :-)
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8430
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Edison Member
*
Karma: 44
Posts: 1471
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can totally takeover the SysTick interrupt.  The plan is to have a weak symbol for
Code:
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.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 121
Posts: 8430
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, thanks.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: [1]   Go Up
Jump to: