7 Replies Latest reply on Jan 10, 2019 4:01 AM by SrinathS_16

    auto commit for FX3

    MaXi_1246331

      Does the auto commit happen when max packet size is reached or one buffer is full? Is the buffer size and max packet size the same thing? Assume only one buffer is used for a DMA channel and this buffer is committed.  Could the external device write data to this buffer at the same time while host is reading?

        • 1. Re: auto commit for FX3
          SrinathS_16

          Hello,

           

          - Committing of buffer happens when the size of the buffer mentioned as part of the CyU3PDmaChannelCreate() API is reached. The buffer size and MaxPcktSize need not always be the same.

          - With only one buffer being used, the external device cannot write data to the buffer while the host is reading from the same buffer.

           

          Best regards,

          Srinath S

          • 2. Re: auto commit for FX3
            MaXi_1246331

            If MaxPacketSize is set to1KB, Buffer size is set to 16KB. If external device continue to send data to P port, what happens if the quantity of data reach 1K? I think auto commit will not happen because the buffer size has not been reached. What if the packet end is asserted at the 1004th bytes?

            I assume only one buffer just for understanding, not in real use.

            • 3. Re: auto commit for FX3
              SrinathS_16

              Hello,

               

              --> If MaxPacketSize is set to1KB, Buffer size is set to 16KB. If external device continue to send data to P port, what happens if the quantity of data reach 1K?

              Data will not be committed to the host because the buffer size has not been reached.

               

              --> What if the packet end is asserted at the 1004th bytes?

              Short packet with 1004 bytes will be committed to the host.

               

              Best regards,

              Srinath S

              • 4. Re: auto commit for FX3
                MaXi_1246331

                If packet end are asserted after sending 1004 bytes from external device, which is larger than the max packet of 1000( lets assume 1K == 1000, I make a mistake previously to think 1K=1000. Now let assume it is true). Then what is the max packet size used for?

                • 5. Re: auto commit for FX3
                  SrinathS_16

                  Hello,

                   

                  'MaxPcktSize' is a parameter obtained by the host as part of the desrciptor information and the bytes of data requested/sent from the host cannot exceed this 'MaxPcktSize' value in each transaction.

                   

                  Let us assume the normal 1K = 1024 bytes and the packet end is asserted after 1028 bytes.

                   

                  In this case, when 1028 bytes are requested from the host, the USB transfer would be split into two separate transactions of 1024 bytes and 4 bytes. The MaxPcktSize parameter is used by the host to split the transfer into multiple transactions.

                   

                  Best regards,

                  Srinath S

                  • 6. Re: auto commit for FX3
                    MaXi_1246331

                    Does MaxPcktSize have influence on FX3 to host transfer? I think no according to your explanation.

                    the splitting of data is not by user, but automatically by the API function the user calls?

                    AUTO commit is only related to FX3 to host transfer, not the host to FX3 transfer?

                    Thank you.

                    • 7. Re: auto commit for FX3
                      SrinathS_16

                      Hello,

                       

                      - Does MaxPcktSize have influence on FX3 to host transfer?

                      No.

                       

                      - The splitting of data is not by user, but automatically by the API function the user calls?

                      The splitting of data is done by the USB stack. The data is split into chunks of MaxPcktSize and then transferred.

                       

                      - AUTO commit is only related to FX3 to host transfer, not the host to FX3 transfer?

                      AUTO commit is only between the different blocks of FX3 (say USB to GPIF II, USB to I2C, SPI to USB etc.).

                       

                      Best regards,

                      Srinath S