7 Replies Latest reply on Mar 14, 2019 9:45 PM by SrinathS_16

    XferData Fails with 997 only after Windows Startup

    stric_2606221

      Hello,

       

      I'm working with an EZ-USB FX3 development kit, connected to a Windows 7 64-bit machine, running my dll which uses the cyapi.lib library. My question is specifically to a failure with the XferData() method on the bulk-out endpoint.

       

      My dll initializes the board (where the FX3 is connected) and programs both the RAM (.img file via CCyFX3Device.DownloadFw) and the FPGA (.bin file via BuilkOutEndPt.XferData) firmware; those two files are our own code. This board is connected to a windows 7 machine and both receive power to be turned on at the same time. After windows startup, I run my dll and the XferData() fails with error 997 (after checking LastError). This error is also seen even if Reset() and Abort() are issued before using XferData. However, if the board is NOT connected to the computer during startup, and then the board is turn on and plug in after windows is ready, everything works just fine (ie. no errors at all).

       

      This behavior is really, really weird since it seems to be connected somehow to the windows startup sequence. We have also tried using a Windows 10 64-bit machine but with the same results.

       

      If anybody has any ideas why we are seeing this error at startup only, or knows how to fix it, please let us know! We'd really appreciate any help.

       

      Thanks,

       

      -Stalin

        • 1. Re: XferData Fails with 997 only after Windows Startup
          SrinathS_16

          Hello Stalin,

           

          - Please issue the Abort() and Reset() request to the corresponding endpoint before using the XferData() API. This would clear any HALT conditions on the endpoint.

           

          Best regards,

          Srinath S

          • 2. Re: XferData Fails with 997 only after Windows Startup
            stric_2606221

            Hi Srinath,

             

            Thanks for your answer. Unfortunately, I have already tried using both of those and the result is the same. Sorry, I forgot to mention that on my original post. The post is now updated to mention this.

             

            Thanks,

            -Stalin

            • 3. Re: XferData Fails with 997 only after Windows Startup
              SrinathS_16

              Hello Stalin,

               

              - Please check with the C++ based Streamer application provided by Cypress and check if the same behavior is observed.

              - If possible, capture the USB traces using a protocol analyzer and share the same.

               

              Best regards,

              Srinath S

              • 4. Re: XferData Fails with 997 only after Windows Startup
                stric_2606221

                Hi Srinath,

                 

                Unfortunately, the cypress Streamer application does not show any endpoint, so I'm unable to check the behavior of our board.

                Streamer.png

                I'm not sure why this is the case, as you can see in the following screen shot, the cypress USB Control Center application does show all the endpoints we use.

                ControlCenter-Streamer.PNG

                Both of those applications are the original executables from the Cypress Suite USB 3.4.7 examples.

                 

                Is the Streamer application expecting something from a cypress firmware example to be able to display the endpoints? As I mentioned on my original post, we are using our own firmware and it would be very difficult to change it.

                 

                Thanks,

                -Stalin

                • 5. Re: XferData Fails with 997 only after Windows Startup
                  SrinathS_16

                  Hello Stalin,

                   

                  The Streamer that you are using is an older version. This version of Streamer expects a VID/PID of 0x04B4/0x1003 in the device. But, this limitation has been overcome in the latest version of the Streamer that comes with the FX3 SDK. Please install the SDK and find the Streamer application in the below path.

                  C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\c_sharp\streamer

                   

                  Best regards,

                  Srinath S

                  • 6. Re: XferData Fails with 997 only after Windows Startup
                    stric_2606221

                    Hi Srinath,

                     

                    I installed the latest version of the SDK (1.3.4). For some reason the c# Streamer application didn't work, with the following error message:

                    error-c-sharp.png

                    On the other hand, the cpp Streamer application did open, but unfortunately, it showed the same behavior as my dll. That is, it failed to send all the packets to the same endpoint where I'm using XferData to program the FPGA firmware.

                    cpp_streamer.png

                     

                    Please see USB traces attached to this response.

                     

                    Does this mean that there is something Windows startup sequence is doing that leaves the FX3 in a state that creates this error? Or do you have any other suggestions?

                     

                    Thanks,

                    -Stalin

                    • 7. Re: XferData Fails with 997 only after Windows Startup
                      SrinathS_16

                      Hello Stalin,

                       

                      - I tested using the USBBulkLoopAuto firmware example that comes with the FX3 SDK firmware. I loaded this firmware image file onto the EEPROM and set the PMODE[2:0] lines to I2C boot. I connected the device to the PC and performed a restart of the machine and I was not seeing any issues with the data transfer. I tested using the FX3 SuperSpeed Explorer Kit. Please let me know if you are testing using the same hardware or the older FX3 DVK.

                      - Please add UART debug prints in the device firmware at the thread loop and use UART terminal on the PC to check if the firmware is running fine.

                      - Also, please capture USB traces using a hardware analyzer like LeCroy and share the same.

                       

                      Best regards,

                      Srinath S