RTEMS event send/receive - events apparently lost.

Joel Sherrill joel.sherrill at OARcorp.com
Wed Mar 21 20:38:46 UTC 2001


Nick.SIMON at syntegra.bt.co.uk wrote:
> 
> Is anyone aware of a problem in events in rtems 4.5.0 beta 3a?

Not this one. :) 

More than likely, this is simply a case of two events happening
too close in time and the 2nd one is just lost.  Correct behavior.

> I have a task which waits for time and frame events like this:
> 
>         while(1)
>         {
>             rtems_event_set got;
> 
>             sc = rtems_event_receive(ITS_ETH_EVENT | ITS_TIM_EVENT,
>                 RTEMS_WAIT | RTEMS_EVENT_ANY,
>                 0,
>                 &got);
> 
>             // Process incoming ethernet packets
>             if(got & ITS_ETH_EVENT)
>             {
>                 // Received one or more packets
>                 int len;
> 
>                 while((len = pkt.pktRcv()) != 0)
>                     if(pkt.isCbpId())
>                         pkt.dispatch();
>                     else
>                         printf("ITS - unrecognised packet header.\n");
>             }
> 
>             // Process timer tick
>             if(got & ITS_TIM_EVENT)
>             {
>                 TimerManager::instance()->tick();
>             }
>         }   // end main event loop
> 
> On occasion we seem to miss ITS_ETH_EVENTs (we may also be missing TIM
> events, I don't know), possibly as a result of the two events being sent in
> close time proximity to each other.
> 
> The ETH event is sent by another task, and the TIM event is from a timer
> service routine (is that an issue?).
> 
> Is anyone else aware of a problem in this area?  Processor is mpc860, and
> BSP is based on eth-comm BTW.  I can work around this by always checking for
> incoming frames instead of testing the event flag (i.e. lose the line
> "if(got & ITS_ETH_EVENT)").
> 
> TIA,
> 
> -- Nick Simon
> 
> ******************************************************************************
> 
> Check us out at http://www.syntegra.com
> 
> ***********************************************************************

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985



More information about the users mailing list