I'm new to a program using the F2812 (DSP/BIOS and CCSv2, ugh). Instead of calling TSK_checkstacks() via the task Switch function, the code calls it from the Idle task. It turns out that even when I force a stack overflow, I don't see a SYS_abort called. In other words, the stack checking isn't working.
I've verified that the task I cause to overflow in one of the 11 being checked (see code below), and I've also verified that the entries in the StackCheck.tasks array are usable by the other TSK_<functions> such as TSK_getname(), TSK_stat(), and TSK_getpri(). My method for forcing a stack overflow was to reduce the size of the task stack in the *.cdb file until it could still start up correctly, but then would overflow after a few minutes of operation.
Should I be able to get it to work from the Idle task? If possible, this would be nice to do since this is production code and I want to minimize changes. If this is not a workable solution, I'd like to know so I can move on. I have no idea why the original designers made the choice to run from the Idle task instead of via the task Switch function, and they are long gone.
#define NUM_STACK_CHECKS 11
static void BackgroundStackOveflowCheck(void)
{
USHORT i;
/*
* Check the stacks for overflow.
*/
for (i = 0; i < NUM_STACK_CHECKS; i++)
{
/*
* update the taskID that will be tested next,
* we use this taskID for reporting if test fails.
*/
currentTaskID = i;
StackCheck.current_task = StackCheck.tasks[i];
/*
* Will call gAbort if the oveflow check fails.
*/
TSK_checkstacks(StackCheck.tasks[i], StackCheck.tasks[i]);
}
/*
* Update the statistics.
*/
StackCheck.count++;
}
thanks,
Lyn