2 Replies Latest reply on Oct 26, 2015 10:45 PM by shuichi.yokota

    FX3 xferdata API returns NULL packet

    shuichi.yokota

      Hi

         

      My VB application working on .NET4.0 Windows 8.1 x64 receives bulk data from FX3 via USB3.0 and sometimes xferdata API returns full of NULL packet. 

         

      For example, when the API receives 14.296bytes of data,  length parameter is precisely returned 14,296 bytes but the buffer contains all NULL of data.
      In this time, on SysNucleus's USBTrace program shows correct packet in the trace dump instead of NULLs.
      So,  I suppose data is transferred fine between FX3 and the driver, but the driver and API.

         

      Here is snip of the codes.
      Any ideas ?

         

              Dim XferCompleted As Boolean = False
              Dim Reclen As Integer = 0
              Dim curEndPt As CyUSBEndPoint = curRcvEndPt.GetEndPt()

         

              Reclen = Data.Length
              If curEndPt IsNot Nothing Then
                  If (curEndPt.bIn) Then
                      Dim bulkEpt As CyBulkEndPoint = CType(curEndPt, CyBulkEndPoint)
                      bulkEpt.TimeOut = TimeoutReceive     ' 1sec
                      XferCompleted = bulkEpt.XferData(Data, Reclen, False)  ' <----- Reclen is 14,296 but Data is all Nulls...
                      If Reclen <> 0 Then
                          XferCompleted = True
                      End If
                  End If
              End If

        • 1. Re: FX3 xferdata API returns NULL packet
          shuichi.yokota

          I've updated the codes as follows but the situation are same...
          In addition, it seems this problem does not repro on USB2.0 port.

             

                  Dim XferCompleted As Boolean = False
                  Dim Reclen As Integer = 0
                  Dim curEndPt As CyUSBEndPoint = curRcvEndPt.GetEndPt()

             

                  Reclen = Data.Length
                  If curEndPt IsNot Nothing Then
                      If (curEndPt.bIn) Then
                          Dim bulkEpt As CyBulkEndPoint = CType(curEndPt, CyBulkEndPoint)
                          bulkEpt.TimeOut = TimeoutReceive
                          XferCompleted = bulkEpt.XferData(Data, Reclen, False)

             

                          If XferCompleted = True Then
                                        ' data received
                          End If
                      End If
                  End If

          • 2. Re: FX3 xferdata API returns NULL packet
            shuichi.yokota

            There's a workaround.
            50ms or more delay just before XferData call clears the problem.
            However it affects the throughput heavily.

               

            Any thoughts ?