1 2 3 Previous Next 30 Replies Latest reply on Mar 7, 2014 2:47 AM by kalev.sildaru

    About sending multiple of 1kB using FX3

    suyang208

       My system is composed with FPGA and FX3.

         

      The PKTEND# single  was inserted  along with the last word of data,  and the sizeof of every FX3 buffer was set 16KB.

         

      I don't know why  that PC received nothing, when i sent multiple of 1KB data ,but smaller than 16KB,  from fpga to FX3.

         

      Can somebody tell me how can i send multiple of 1KB data ,but smaller than 16KB,when the sizeof of every FX3 buffer is set

         

      16KB.

         

      Thanks

        • 1. Re: About sending multiple of 1kB using FX3
          gayathri.vasudevan

           Hi,

             

           

             

          which project ar eyou using? Are you testing using AN65974 GPIF project, or is that your custo project?

             

           

             

          Regards,

             

          Gayathri 

          • 2. Re: About sending multiple of 1kB using FX3
            content.librarian

            Hi,

               

            if you are using the slave fifo interface then assert packet end with the last write. Then FX3 should commit the data to host.

               

            regards,

               

            lumpi

            1 of 1 people found this helpful
            • 3. Re: About sending multiple of 1kB using FX3
              suyang208

              Under the situation mentioned above, pc host received nothing , when i send 1kB once.

                 

              After the sending of the second time,PC received 2 packets, one is 2KB,another is 0KB.

                 

              I don't know what 's the reasion.

              • 4. Re: About sending multiple of 1kB using FX3
                rama.sai.krishna.vakkantula

                 Suyang,

                   

                Please create a tech support case so that one of our customer support engineer helps you in solving your issue.

                   

                Let me know if you need any help in creating the tech support case.

                   

                Thanks,

                   

                Sai Krishna.

                • 5. Re: About sending multiple of 1kB using FX3
                  mudabir.kabir.a

                   Hi suyang208,

                     

                   As Lumpi pointed out, the PPORT buffer content will not transferred automatically to USB end till the buffer is full. If you are sending 1KB of data external source to Slave Fifo buffer of bigger size (16 KB in your case), you  need to assert PKEND signal with SLWR and SLCS signals for last word write. 

                     

                  I assume you are using the Slave Fifo state machine provided as example project with GPIF 2 designer. It should work fine

                     

                  Alternatively, you can try with the state machine and firmware I have attached in the .zip file..

                     

                  This state machine is similar to Slave Fifo example project provided except that , for short packets (anything less than 16KB) instead of doing COMMIT action in GPIF state, interrupt is generated using INTR_CPU action and commit action is done in the firmware using CyU3PDmaChannelSetWrapUp() API which is called in CyFxApplnGPIFEventCB() function ( Registered callback function for the INTR_CPU action) . You can also add UART debugprints to check if callback is happening.

                     

                   

                     

                  Regards

                     

                  Mudabir Kabir

                  1 of 1 people found this helpful
                  • 6. Re: About sending multiple of 1kB using FX3
                    mudabir.kabir.a

                     I am sorry. I couldnt upload the files here. Here is the link to the attachment.

                       

                    https://docs.google.com/file/d/0B-EPqwXSNA3lUENWRTZRbTcxR1E/edit?usp=sharing

                       

                    Regards

                       

                    Mudabir Kabir

                    1 of 1 people found this helpful
                    • 7. Re: About sending multiple of 1kB using FX3
                      suyang208

                       hi, Mudabir Kabir, thanks for your answer!

                         

                      Following your advice,it will work when sent data size of whick is non-integer multiples of 1KB(less than 16KB),just like 1KB+4B.

                         

                      But it doesn't work when the size is multiples of 1KB,the result is the same that pc can't receive any packet ,when the size of urb is set the same as the size of the dma buffer(16KB).

                      • 8. Re: About sending multiple of 1kB using FX3
                        mudabir.kabir.a

                        Hi,

                           

                        Can you elaborate about your application so that we can help you further.

                           

                        What is the External Master you are using. For a 16 KB buffer, 1KB or 1KB+4 bytes , both are considered short packets and on asserting PKEND signal with SLWR and SLCS, the data should be committed to USB end. 

                           

                        In the previous post , on using interrupt CPU method, did you see callback occuring. ( You can check using UART debugs). This will help tell if the problem is with the Slave Fifo state machine or external master.

                           

                        Regards

                           

                        Mudabir Kabir

                        1 of 1 people found this helpful
                        • 9. Re: About sending multiple of 1kB using FX3
                          gayathri.vasudevan

                           Hi

                             

                           

                             

                          Are you trying fro Control center or custom application? If custom application, can you try with Control center. What do you mean by "pc can't receive any packet ,when the size of urb is set the same as the size of the dma buffer(16KB)"?

                             

                           

                             

                          Regards,

                             

                          Gayathri

                          1 of 1 people found this helpful
                          • 10. Re: About sending multiple of 1kB using FX3
                            suyang208

                             Hi .

                               

                                 The whole question is described in the  attached Image.

                               

                                 I don't know the reason of Red Part, and how can i to send the multiples of 1KB data by FPGA.

                            • 11. Re: About sending multiple of 1kB using FX3
                              kalev.sildaru

                              Hi,

                              In PC application, multiple to packet size buffer must be provided to USB driver to perform read from device. USB driver will complete the read operation when the whole buffer gets fulfilled, or, it receives Short Packet (data amount in packet is less than max packet, but not zero) or Zero Length Packet (ZLP, data amount in packet is 0) from device.

                              So, if you want to receive packet size (1KB) chunks of data in PC application, you can provide just a packet size read buffer there.

                              If you provide bigger buffer then device must send Short Packet or ZLP to force the read operation in PC to complete prematurely.

                              If you assert PKTEND simultaneously with last data then FX3 commits data to PC. In cases where data amount in FX3 buffers is not multiple to packet size, the last packet sent to PC will be naturally Short Packet. And this completes read operation in PC.
                              If data in buffers is multiple to packet size, then the last packet will be the full packet. And of course this does not complete the read in PC.
                              You have to force FX3 to send extra ZLP in this case.
                               

                                 

                              Br,
                              Kalev

                               

                              1 of 1 people found this helpful
                              • 12. Re: About sending multiple of 1kB using FX3
                                suyang208

                                Hi,thanks for your answer !

                                   

                                I used extra ZLP ,but some  phenomenon  which could not be understood occured ,shown the attach image.

                                • 13. Re: About sending multiple of 1kB using FX3
                                  gayathri.vasudevan

                                   Are you deasserting the SLWR and asserting PKTEND at the same time? If so, try giving one cycle delay after deasserting the SLWR and then assert PKTEND signal.

                                     

                                   

                                     

                                  regards

                                     

                                  Gayathri

                                  • 14. Re: About sending multiple of 1kB using FX3
                                    suyang208

                                    I have given four cycles delay after deasserting the SLWR and then assert PKTEND signal,but the result was the same.

                                    1 2 3 Previous Next