I have task named X. I’m registering for a callback function in my task X and then start blocking on a queue Y. When a packet is recieved from MAC my registered callback function is called. Everything is ok up to this point.
But when I try to post to queue Y in this function I face some problems. I could not localize the problem because of these questions.
1) Can we say this callback function is running in the context task X? or it is running in the context of MAC task(namely lwip’ tcp_ip_thread).
2) Where does this callback function returns?
But I could not solve it. Let me clarify my situtaion with my source code. I’m using Sam7x Web server demo. There is two tasks which I’m interested. task_debug_info and tcp_ip_thread. As it is seen in the code, task_debug_info start receiving from a queue. When data arrives from ethernet tcp_ip_thread calls a function named net_recv. And net_recv sends data to the queue. Problem is if I don’t post to the queue in the net_recv, everything is ok. But,if I call QueueSend than ethernet comm becomes faulty( I think tcp_ip_thread).
Below is my source-code. Thanks
void task_debug_info( void *pvParameters )
{
//Task specific variables
debug_info dbg;