2 Replies Latest reply on Dec 8, 2015 5:15 PM by userc_40724

    Usage of XferData() blocked io function

      Hello,

         

       

         

      I and my colleague are developing an usb peripheral using CY3014 FX3 chip. We've just began and tried to build a dummy application to warm up. My colleague, he wrote FPGA code generating dummy data sequentially and I wrote a test pc application to read them.

         

       

         

      Using CCyUSBEndPoint::XferData() method, we succeeded to read 7~8 subsequent data but failed then. The method was blocked and released after ~5 seconds with 'false' returned. It supposed to read data every second.

         

       

         

      My question is : what happened if the XferData() method is called when the buffer is empty and the buffer is filled right after. It's my first time writing peripehral application and I expected something like socket i/o : blocked when the buffer is empty and released right after data arrived.

         

       

         

      Cheers.

        • 1. Re: Usage of XferData() blocked io function

          Hi,

             

          When the XferData is called when Buffer is empty, the XferData waits until the Timeout value of the endpoint (which you can specify in your code). If the buffer doesnt get filled within the timeout, the XferData returns false. Please play around with the timeout value and see if it suits your test environment.

             

          Regards,

             

          - Madhu Sudhan

          • 2. Re: Usage of XferData() blocked io function

            Thanks for your comments.

               

             

               

            Our program on FPGA chip supposed to generate pseudo data at every 1ms and fill buffer. Because the timeout  is much longer than that, I think XferData cannot reach timeout. Can you tell me what I can check?

               

             

               

            Best regards,

               

            - Taehan.