1 2 Previous Next 15 Replies Latest reply on Oct 3, 2013 4:01 AM by kalev.sildaru

    Control IN transfer fails when the response size is multiple of packet size.

    tatsuya.kudoh

      Hi,

         

      FX3 Control IN request fails when the response size is:

         
            
      • multilpe of the packet size (64, 128, 192.. for HS, 512, 1024, 1536.. for SS)
      •     
      • smaller than wLength (if response size equals wLength, no problems occur)
      •    
         

      The error occurs in PC side (ex, Control Center shows error 997)

         

      but in the firmware side, CyU3PUsbSendEP0Data() returns no error.

         

       

         

      I guess, in this situation, the last ZLP may be lost.

         

      In Setup Request callback, calling additional CyU3PUsbSendEP0Data() with 0 bytes length

         

      hides this problem,  like this:

         

       CyU3PUsbSendEP0Data( bytes, buf );

         

      if( (bytes % glPacketSize) == 0 )

         

          CyU3PUsbSendEP0Data(0, buf);

         

      This workaround code is Appropriate?

         

       

         

       I attach test project.

         

      This firmware accepts Vendor-IN Request, and response [wValue] bytes.

         

      If wIndex is 1, the workaround is enabled.

         

       

         

      Regards.

        1 2 Previous Next