chipKIT® Development Platform

Inspired by Arduino™

Native code / RTOS

Created Tue, 17 Jul 2012 06:31:15 +0000 by skyjumper


skyjumper

Tue, 17 Jul 2012 06:31:15 +0000

Hi All...

I'm looking at implementing a multi threaded web server, and wondering if anyone knows of a RTOS that runs on either the UNO32 or the MAX32?

I see that the FreeRTOS website says that it runs on PIC32. Is it possible to run FreeRTOS on a Chipkit board?

Thanks...


ethan

Wed, 01 Aug 2012 01:13:29 +0000

Possible? Certainly. I have it running on a custom board that is very similar to the MAX32. The FreeRTOS kernel is actually very easy to reconfigure. That is using native Microchip C32 though. There is a Arduino port called duinOS, can't post the link as I am too new. I'm not sure how much work would be involved to get it running but I am probably going to attempt it very soon.


skyjumper

Wed, 01 Aug 2012 02:01:57 +0000

Thanks Ethan, I'll google duinOS and see what I can find. Is this a port of FreeRTOS that runs on an Arduino board or on a Chipkit board?

Thanks again, I'll see what I can find.


ethan

Thu, 02 Aug 2012 02:36:29 +0000

DuinOS was written for Arduino boards. According to their website they have it running on the ATMega168 through the 1284. From looking at it I'm not sure if it will meet my needs or not. I put the bootloader back on my board and now I'm having a couple of issues getting my FreeRTOS code running. It worked on the same board before, albeit with no bootloader.


ahnise

Fri, 24 Jul 2015 20:45:57 +0000

Has anyone had luck with running an RTOS with Chipkit ? I am about to embark on doing this, and am considering a few approaches:

Pull an RTOS into my existing Chipkit application: By biggest concern in doing this is that some of the chip level drivers may not be clean enough. For example, the bit banged SPI port used by the SD Card driver would not really work well with the RTOS. (Actually I am curious if this was cleaned up in later versions of Chipkit).

Generally, my view is that for Chipkit to be RTOS upgradable, the drivers for things like I2C, SPI, and UARTs, would need to:

  1. Use their respective hardware modules.
  2. Be interrupt based.
  3. Have reentrant code.

I would expect that I would need to do some rewriting of the Wire, Serial, SPI, and possibly the SD Card libraries.

The question then becomes, how much work would this be ? Has any progress been made with these drivers towards making them interrupt based ?

Arduino-ize Harmony This approach would to allow MPLABX's Harmony to auto-generate the low level system (Chip level drivers, and FreeRTOS) and then make mid level drivers which wrap the Harmony Code and publish it using Ardunio compatable APIs (For example, wrapping the Harmony UART driver with the Arduino Serial class.)

With this approach, the RTOS is already integrated, and the lower level drivers would be reasonably robust. The down side is that I would kind of be rewriting ChipKit (with the advantage that I only needs to wrap what I was going to use.)

Go to a different Chip

There are some RTOS integrations completed for Atmel and Teensy based systems. While the RTOS is available, it is unknown wether these integrations do anything to address the Arduino base code to make it play nice with the RTOS.

Does anyone have any ideas on this subject ? Has anyone run Chipkit with an RTOS ?