rtel wrote on Saturday, June 16, 2012:
You are asking people to speculate on an awful lot here, with very little assistance.
I have a thread that runs PPP and works well sending/receiving data.
Which stack are you using (curiosity, more than anything).
When I try to close ppp and call the pppClose I encounter a hard fault.
Which processor are you using? Which code causes the hard fault? You should be able to determine that from the register and/or stack when the hard fault occurs - but how that is done depends on the processor.
It appears when the thread ppp_input is deleted and in the line portYIELD_WITHIN_API();
The call to portYIELD_WITHIN_API() inside the vTaskDelete() function? If so, then that would imply the ppp_input task was deleting itself.
In the main task where I do my PPP init,send data if I add a while loop as below and once a context switch occurs when the ppp_input task is deleted this doesnt crash
So it is not the vTaskDelete() function that is crashing, but completing correctly, and only if the main task continues from that point that the crash occurs? Does the main task use the ppp task again after it is deleted? Was the ppp task blocked on any semaphores or queues when it was deleted?
the main task. I then set x = 1 with the debugger.
….and what? It crashes? It doesn’t crash?
I cant think of where the problem might be. Is the stack corrupting in some way?
Maybe, but maybe not. Do you have stack overflow checking on?