1 Reply Latest reply on Jun 21, 2018 9:20 PM by SrinathS_16

    FX2LP How to manually empty the buffers of an IN endpoint by the firmware?

    FrZa_2625781

      Hi,

       

      I have an Bulk IN endpoint with Auto-IN enabled that is constantly filled with data from the external master.

      After a pause in data transfer I might want to discard the presumably old content of the endpoint buffers before I continue with the new transfer.

       

      What do I have to write in which registers to declare the input buffers empty so that they can accept new data from the external master?

       

      I assume this is an easy and silly question, but I have worked overnight on my previous problem and my brains feel like two soaked loafs of old bread.

       

      Many thanks for any help!

        • 1. Re: FX2LP How to manually empty the buffers of an IN endpoint by the firmware?
          SrinathS_16

          Hello Frank,

           

          To discard the data that has already been committed to the host, the FX2LP has to be switched to MANUAL mode. Implement the below piece of code to discard the data and re-enable the endpoint buffer to be filled by external master.

           

          FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions

          SYNCDELAY;

          EP6FIFOCFG = 0x00; //switching to manual mode

          SYNCDELAY;

          FIFORESET = 0x06; // Reset FIFO 6

          SYNCDELAY;

          EP6FIFOCFG = 0x0C; //switching to auto mode

          SYNCDELAY;

          FIFORESET = 0x00; //Release NAKALL

          SYNCDELAY;

           

          Best regards,

          Srinath S