3 Replies Latest reply on Nov 4, 2015 7:41 PM by userc_40865

    About sending multiple of 1kB from host

      I am working for a FX3 "communication bridge" between computer and FPGA. The FX3 works in 32 bit slaveFIFO mode. The PC's OS is Ubuntu 14.04.


      When I send integer multiple of 1kB data from PC host to FPGA, for example 2kB, FPGA receives nothing, but I can see the data has been sent from PC by Wireshark and the sending function returns "success". However, when I send non-integer multiple of 1kB data to FPGA, for example 2kB+4B, everything works well.


      And if I send multiple of 1kB at first and then send non-integer multiple of 1kB, FPGA will receive both two after the second sending.


      In addition, there is no problem in the direction of FPGA to PC, no matter what the data length is.



        • 1. Re: About sending multiple of 1kB from host

          Have you tried sending a zero length packet to tell the fx3 there is no more data?




          If you're filling a dma channel that is 1024*(dma multiplier=2) bytes, the buffer won't be committed until either it is full or it gets a short packet.  The problem is that when the first packet is 1024 bytes it doesn't appear to me to know that there is no more data coming so in that case I send a zlp which then causes the buffer to be committed to the firmware.


          Anyhow, I ended up just sending a zlp at the end of all my USB out transmissions.  Didn't seem to hurt anything and fixes the issue where the buffer isn't committed past the firmware.

          • 2. Re: About sending multiple of 1kB from host

            Thank you for your reply.


            I understand it to some extent. I'll try it tomorrow and update the result.



            • 3. Re: About sending multiple of 1kB from host

              I tried the #2's method and succeeded. But there might be some quesions if I send ZLP by modifying the transfer_flags, it's likely to be related to the USB controller in my computer. so I finally send the ZLP by sending a packet of length zero;