xc8 port (for PIC18F8520)

mlcompile wrote on Sunday, May 31, 2015:

I have spent a little bit of time looking at what is required to get freeRTOS working on a PIC18F8520. Now from initial reading before downloading freeRTOS it all looked pretty alright and standard demos were available. These demos were in MPLAB V8 etc but it seemed that most of the work should have been done.
Unfortunately I only have MPLABX with xc8 compiler. And the problems just continue from one to the next with the compiler just throwing out rubbish errors. Such things include the asm (asm() instead of __asm) directive, I can’t seem to get the compiler to recognise the \ (macro newline character) and interrupts are very called differently.
Most of these are porting issues of course but as this was purely an exercise to familiarize myself with freeRTOS it feels like it is not worth the hassle. I only have a pic18f8520 at hand btw.

I found a few posts going back a few years now which did confirm that freeRTOS wasn’t ported to xc8 etc but I was hoping to just get a quick update on that. There is also quote here stating that no one supports this setup:

http://stackoverflow.com/questions/24984493/using-freertos-with-xc8-compiler

Has anyone one actually ported the freeRTOS to onto xc8?

Also unless I am have not seen them, I have not found any demos for the new MPLABX for the xc16 compiler. Is there any plan in the future to bring freeRTOS into the MPLABX IDE?

amarjith wrote on Monday, June 01, 2015:

I have tested “FreeRTOSV8.2.1\FreeRTOS\Demo\PIC24_MPLAB” in MPLABX with Xc16 compiler without any issue.

hollenweger wrote on Wednesday, June 03, 2015:

The demos (and ports) for the 16Bit devices are easy convertible for MPLAB-X and XC16 (the XC16 compile is noting else then a new version of the “original” MPLAB-C18 compiler).
I would strongly discourage the use of FreeRTOS on the 8 Bit devices from Microchip (they are simply not made for a RTOS). Furthermore last time I tried to use the XC8 (about a year ago) the compiler had some very nasty bugs.

tlafleur wrote on Wednesday, June 03, 2015:

Unless your building thousand of something, the cost difference between the
8bit --> 16bit -->32bit chips are only a few cents… Even in large volume
cost sensitive project, one need to look at development cost vis chip cost.

The development cost of using a small chip is high compare to using the
more complete and highly integrated 16 or 32 bit chips, with better tools,
this will quickly offset the cost difference.

Today, I would not start a small project (under 500 devices per year) with
an 8 or 16bit chip unless their were some very special requirement… the
32bit parts are faster, more ram, more flash, better tools and cost about
the same…

Save yourself a lot of pain trying to use a small chip… Move up to the 32
bit world! look at the PIC32MX270 part… its in a 28pin package… its
cheap! or move up to 44, 64 or 80 pin devices as needed… you will not
look back…

Tom Lafleur

tlafleur wrote on Wednesday, June 03, 2015:

“Also unless I am have not seen them, I have not found any demos for the
new MPLABX for the xc16 compiler. Is there any plan in the future to bring
freeRTOS into the MPLABX IDE?”

also, I have a number of older project that use the 16bit parts with
FreeRTOS. All run under MPLAB 3 and XC16 , If I recall, port to XC16 was
less that 1/2 hr of work…

Tom Lafleur