Hi MQXuser,
Best location is to look in the ~Freescale MQX 3.x\doc\mqx\MQXUG.pdf section 3.7.8. It explains the fifo ask and reviews the example that is in the ~Freescale MQX 3.x\mqx\examples\taskq directory.
Regards,
David
I read the documentation before but there are still some questions. To be more specific:
Can I place the same task two times into the task queue?
I need to synchronize a task with an ISR but I need that the task executes 1 time by everytime the interrupt is triggered. If the interrupt gets triggered faster than the task: Can I still make the task run all the times the interrupt have been triggered?
Regards,
I am not sure what my problem is but I have certain clues.
My interrupt post a semaphore.
This interrupt gets triggered about every 2ms for a period of around 50ms. The last time the interrupt gets triggered(from each 50ms group) must post a semaphore but for some reason I get an Unhandled Interrupt comming from shell task. It is like if the interrupt didnt have enough time to run before the next interrupt pulse comes. How can I overcome this?
The code works fine without posting the semaphore, like if the semaphore post instruction is making the interrupt too long. Could be this causing the problem?
void GPT_C0F_ISR(pointer dummy_param){ Door3Counter++; if(Door3Counter >= 26){//When is the last bit Door3Counter = 0;//Reestart the counter FifoInsertDataID(codeReadD3, 8); //Codigo y La Puerta _lwsem_post(&sem_cardRead); //Posts the semaphore } readCounter(0); //Clears the Interrupt flag return;}
1. Did your create the semaphore before using it?
2. Set a breakpoint on the _lwsem_post. Use Task Aware Debugging to display LW semaphores. Ensure the semaphore is listed and is valid.
3. Is your interrupt stack big enough?
Thank you for your help.
1.-Yes I did.
2.-Yes, semaphore is listed and is valid.
3.-How can I check that? The error that comes is unknown error and not Interrupt stack overflow. What I see on hyperterminal is the following:
***UNHANDLED INTERRUPT ***
Vector #: 2 0x2
Offset : 8 0x8
Task Id: 0x10002 Td_ptr 0x20001b68 Stack Frame: 0x20001030
Interrupt_nesting level: 2 PC: 0x00040ccc SR: 0x2600
How can I check if I have enough stack?
How can I increase it?
Thanks
QUEUE_ELEMENT_STRUCT_PTR _queue_dequeue
(
/* [IN] the queue to use */
QUEUE_STRUCT_PTR q_ptr
)
{ /* Body */
QUEUE_ELEMENT_STRUCT_PTR e_ptr;
_int_disable();
if (q_ptr->SIZE == 0) {
_int_enable();
return(NULL);
} /* Endif */
_QUEUE_DEQUEUE(q_ptr, e_ptr);
_int_enable();
return(e_ptr);
} /* Endbody */
Second time I try to post the semaphore the UNHANDLED INTERRUPT shows in hyperterminal.
When debugging I cant step into _QUEUE_DEQUEUE function. And thats when the error shows.
I have set a breakpoint in that instruction line and the semaphore is valid.