1 Reply Latest reply on Sep 27, 2017 11:48 PM by srnt

    how to pad the packet with dummy data

    zhanghongjay_2089536

        If the master wants to send a stream of data whose length is not a multiple of 512, the last packet is not be automatically committed to USB because it is smaller than 512 bytes. To commit that last packet, the master can do one of two things: It can pad the packet with dummy data in order to make it exactly 512 bytes long, or it can write the short packet to the FIFO, then pulse the PKTEND pin.

        But how to pad the packet with dummy data.

       

        • 1. Re: how to pad the packet with dummy data
          srnt

          Hello,

           

          I assume that you are using the FX2LP product. Please correct me if I am wrong.

           

          In case you have configured the FX2LP to be in Auto-In/Auto-Out modes, it is the responsibility of the external device to pad the packet with dummy data, since the firmware has no control in data transfer.

           

          In case you have configured the FX2LP with AUTOIN/AUTOOUT=0, the firmware can pad the packet with dummy data (or) the INPKTEND register can also be used to implement the hardware PKTEND functionality. To do so, keep track of the EPxBCH/BCL registers and write the INPKTEND register when the packet length is not a multiple of 512 byte.

           

          Best regards,

          Srinath S