rtel wrote on Monday, April 01, 2013:
Where did you get your PIC24 project from?
How did you put your PIC24 project together?
Have you tried building and running the official demo application for the PIC24 that comes in the FreeRTOS zip file download?
Do you have stack overflow detection turned on?
Did you start with something very simple to get confidence that you had integrated the code correctly? I would suggest starting by turning pre-emption off, then creating two tasks that do nothing but yield to each other. For example you can start with just the following two tasks:
volatile unsigned long ul1, ul2;
void vTask1( void *pvParameters )
{
for( ;; )
{
ul1++;
taskYIELD();
}
}
void vTask2( void *pvParameters )
{
for( ;; )
{
ul2++;
taskYIELD();
}
}
Create these two tasks using:
portBASE_TYPE xTaskCreate(
vTask1,
"T1",
configMINIMAL_STACK_SIZE,
NULL,
1,
NULL;
);
portBASE_TYPE xTaskCreate(
vTask2,
"T2",
configMINIMAL_STACK_SIZE,
NULL,
1,
NULL;
);
Start the scheduler, let it run for a while (you may be able to do that in the MPLAB simulator), then pause the debugger. Now if you inspect the ul1 and ul2 variables they should have approximately the same value. Next if you inspect xTickCount (defined in tasks.c) you should find it has incremented.
If that works, then it shows you can yield from one task to another, then you can turn preemption on and take out the calls to taskYIELD() and try it again……
Regards.