rtel wrote on Wednesday, January 04, 2006:
Which processor are you using?
There are a couple of options.
Take a look at the function usTaskCheckFreeStackSpace() in tasks.c. This is what the uIP demo (http://rtosdemo3.redirectme.net) uses to print out the free stack space of every task (link will probably only work from residential computers as most office firewalls will block the nonstandard port number). Note this function disables interrupts for a while so is not a good idea other than for testing.
Secondly the TCB contains pointers to both ends of the stack, so it is easy to see if the two are getting lose. In the task context switch function you could check for this. I don’t do it in the download code because obviously it increases the context switch time - but it may be a trade of you like.
Regards.