I have been having problems with scheduler running properly.
If I have one task (flash the led) it runs fine. But if I add two tasks (led and uart) the machine resets at PC zero. I set a breakpoint in the function void vTaskIncrementTick( void ) and watch the xTickCount variable.
What happens, I start the machine running it increments the xTickCount to 2 and then resets the PC down to zero and starts all over again.
I took the standard project got it running on the demo board and stripped it down the simplest form: (croutine.c, heap_1.c, list.c, port.c, portasm_PIC24.S, queue.c, tasks.c, FreeRTOSConfig.h) I have added two additional files main.c and uart.c.
So there is something I missing in my setup to get the scheduler to run properly and being able to switch between tasks.
I have disable the watchdog timers and brown-out resets.
Suggestions on where to look?
Here is my config info:
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 16000000 ) /* Fosc / 2 */
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( 24 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) 512 )
#define configMAX_TASK_NAME_LEN ( 4 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 1
#define configIDLE_SHOULD_YIELD 1