1 Reply Latest reply on Jul 2, 2012 12:24 AM by rama.sai.krishna.vakkantula

    Skip a packet in AUTO-OUT mode

    demid.sukhovsky

       Hi

         

      I setup the transfer using the auto-out mode. Everything the PC sends to the device is transferred using GPIF transfer.

         

      Unfortunately, I need to skip the first packet, transmit 300 packets, skip 301 packet, transmit another 300 packets and so on.

         

      In the ISR_Ep2inout I check the packet content and try to ignore it before the setting the GPIF transfer.

         

      The code:

         

       

         

      EP2FIFOCFG = 0x01; // manual mode

         

      SYNCDELAY;

         

      OUTPKTEND = 0X82; // skip packet

         

      SYNCDELAY;

         

      EP2FIFOCFG = 0x11; // back to auto out mode, disable PKTEND zero length send, word ops

         

      SYNCDELAY;

         
          does not work. The packet is not skipped and GPIF transfer picks it up.   
         
              
         
          If I use another code that resets FIFO (from TRM):   
         
              
         
          
            FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions    
          
            SYNCDELAY;    
          
            EP2FIFOCFG = 0x01; //switching to manual mode    
          
            SYNCDELAY;    
          
            FIFORESET = 0x02; // Reset FIFO 2    
          
            SYNCDELAY;    
          
            OUTPKTEND = 0X82; // skip the packet    
          
            SYNCDELAY;    
          
            EP2FIFOCFG = 0x11; //switching to auto mode    
          
            SYNCDELAY;    
          
            FIFORESET = 0x00; //Release NAKALL    
          
            SYNCDELAY;    
         
         
              
      then I sometimes skip more than one packet   

       

         

      Is it any way to skip exactly one packet from EP2 buffer and preserve others intact?