moto95 wrote on Tuesday, April 23, 2013:
OK, I am stumped. I’ve had a FreeRTOS application nicely ticking over. Made new additions in the course of development and now the scheduler refuses to run. Tasks get successfully created, but vTaskStartScheduler seems to fail somewhere in xPortStartScheduler. I can trace it to there.
So, I’ve reduced it a very simple main loop and one task. The highly reduced code now is:
#include <stdio.h>
#include <stdlib.h>
#include “main.h”
void vTest (void *pvParameters)
{
for(;
{
PORTToggleBits (OC4);
vTaskDelay (500);
}
}
int main(void) {
// Configure the processor for maximum performance.
SYSTEMConfigPerformance(configCPU_CLOCK_HZ);
// Initialise the system hardware.
DIG_IO_config();
AN_IO_config();
while (TRUE)
{
// For testing, turn on an LED if the task gets created successfully.
if (xTaskCreate(vTest, “test”, 240, NULL, 1, NULL))
{PORTSetBits(OC5);}
// Now start the RTOS scheduler.
vTaskStartScheduler();
// This is just for debug. We should never get here.
for (; {PORTSetBits(OC4);};
}
}
I’ve searched on here and found references to heap and stack size. My settings are:
#define configTOTAL_HEAP_SIZE ( ( size_t ) 8000 )
I am using heap_1.c
I’ve tried increasing the heap size and tried different heap_x.c files. It’s made no difference.
I am using an PIC32MX575 with MPLAB-X and XC-32 compiler.
This ran with far more code than the above with multiple tasks,etc. Now, I can’t even get this simple example to work. There are no compile errors, btw.
Any suggestions on how to get this working again would be greatly appreciated.