I am running into an issue where it looks like a stack is getting corrupted, however I have substantially increased all the stack size to much larger than necessary and still get strange execution.
Basically what is happening is that when I start a task and then break with IAR the call stack shows that a piece of code completely unrelated to the started task is being executed. As best I can tell it appears that it wasn’t even started at the top of the function, hence my belief that the stack got corrupted.
I have two tasks running to start off with.
1. Is a debug tasks taking messages from a queue and putting them out a serial port, as such allowing any other task to put messages on that queue for output. It also has an ISR taking serial input and putting it in another queue
2. Is a command line interface that builds up and allows execution of commands using the queue mentioned for the debug task. One of the commands I have implemented is "ps" that uses vTaskList to output the current task list and status. Other commands allow initialization and starting of the other tasks mentioned above.
The output of ps before starting another task. As you can see there is a fair amount of stack available.
Task Stat Pri Free TCB#
CmdLine R 1 616 1
Debug R 1 26 0
IDLE R 0 107 2
When I start another task this strange execution path is taken and I can no longer interact.
Now I understand why the data structures for the queue’s, task’s etc… are private and from the API everything is void* however this makes debugging painful. Has anyone, or wouldn’t it be a good idea, to have debug versions of the structures such that IAR would allow expansion so visability into the kernel would be available. Alternatively has anyone created a plug-in for the IAR tools to make them FreeRTOS aware?