rtel wrote on Tuesday, June 21, 2011:
From the two comments:
All appears to work except that I get a random Stack Overflow exception.
I run with the stack overflow turned on (2) which is how I found the problem.
Are you getting a stack overflow exception? If so, that is not coming from having the stack overflow protection turned on in FreeRTOS. The mechanism in FreeRTOS will cause vApplicationStackOverflow() to be called, not an exception to occur. I know some PIC architectures have stack limit registers catch stack overflows, but I’m not sure that applies to the MIPS based parts, and FreeRTOS does not use them anyway so that functionality should be off in the hardware.
The Top of stack is pointing into the xISRStack instead of it own stack.
Do you mean the top of stack used by the idle task? If so, then I agree that is wrong. Otherwise, in an interrupt that called vTaskSwitchContext() I would expect the stack pointer at the time the function was called to be in the ISR stack, as, after all, it is being called from an ISR.
so I run all interrupts at the same priority
Was that the lowest priority - so the same priority used by the kernel for its tick interrupt?
Are you using the assembly wrappers for your interrupts?