FreeRTOS Hangs witn PIC18f4550

anonymous wrote on Friday, October 12, 2012:

Hi there,
kindly i need your help running my 1st FreeRTOS program, i used the rtosdemo1 in PIC18_MPLAB demo folder.
i just created my own task to toggle a LED on/off.

after the scheduler starts, the debugger stuck at portRESTORE_CONTEXT();  in void vPortYield( void ) i don’t know what is the reason.

there is no error in compilation.

while in the same function “void vPortYield( void )”, i gets the warning or error about “portSAVE_CONTEXT( portINTERRUPTS_UNCHANGED );”
the message says “unexpected token: _asm”

here is my configuration:
1- MPLAB X IDE v1.41
2- PICC18 Compiler v 3.43
3- FreeRTOS v7.1.0

edwards3 wrote on Friday, October 12, 2012:

The FreeRTOS web site does warn that PIC18 is a bad target for an RTOS. Its architecture does not lend itself, and its compiler assumes single threading.

I suspect your problem is more related to the PIC18 chip architecture not being identical to the base PIC18 chip the port was written on. Changed compiler versions will also give you problems no dount.

anonymous wrote on Friday, October 12, 2012:

would you please send me the link to that article?

i wonder how there is a port for PIC18 in the downloadable source if the PIC18 is not a good target !!

rtel wrote on Saturday, October 13, 2012:

Just because it is not a good target does not stop people from using it.  Consider the hardware stack that has to be swapped in and out as part of a task context, the segmented memory that stacks can’t easily cross, and the fact that the compiler itself is not re-entrant, and you begin to see the problems.

You will see on this page: that the PIC18 is listed, but only in brackets (although it is not made clear on the page why, admittedly).

The PIC18 section of this page: starts by saying it is “less than ideal”.