AnsweredAssumed Answered

_lwevent_set hangs

Question asked by Stefan Eichenberger on Jul 21, 2012
Latest reply on Nov 27, 2012 by William Hookway

Hello everyone


I have a problem in one of my applications. I have a timer interrupt which should trigger every ms an event. The problem is that after some time (20 min - 2h), the _lwevent_set functions hangs up.

      while (q_ptr != (QUEUE_ELEMENT_STRUCT_PTR)         ((pointer)&event_ptr->WAITING_TASKS))      {         td_ptr = (pointer)q_ptr;         _BACKUP_POINTER(td_ptr, TD_STRUCT, AUX_QUEUE);         next_q_ptr = q_ptr->NEXT;         if (((td_ptr->FLAGS & TASK_LWEVENT_ALL_BITS_WANTED) &&             ((td_ptr->LWEVENT_BITS & set_bits) == td_ptr->LWEVENT_BITS)) ||            ((!(td_ptr->FLAGS & TASK_LWEVENT_ALL_BITS_WANTED)) &&             (td_ptr->LWEVENT_BITS & set_bits)))         {  /* Start CR 406 */#if 0            _QUEUE_DEQUEUE(&event_ptr->WAITING_TASKS, q_ptr);#endif            _QUEUE_REMOVE(&event_ptr->WAITING_TASKS, q_ptr);/* End CR 406 */            _TIME_DEQUEUE(td_ptr, kernel_data);            td_ptr->INFO = 0;            _TASK_READY(td_ptr, kernel_data);            /* store information about which bits caused task to be unblocked */            td_ptr->LWEVENT_BITS &= set_bits;            set_bits &= ~(event_ptr->AUTO & td_ptr->LWEVENT_BITS);                     } /* Endif */         q_ptr = next_q_ptr;      } /*

next_q_ptr is equal to q_ptr, so the while loop becomes an endless loop. I don't know why this can happen.


Did someone else already have a similar problem? The interrupt is installed by calling _int_install_isr().


The platform is a Kinetis PK60DN512VLL10 with MQX V3.8 compiled on Codwarrior 10.2.


Best regards