2 Replies Latest reply on Dec 27, 2014 3:44 AM by lim.chong.han

    After first data sent in EP0, the second time give error when send again.

    lim.chong.han

       Hi

         

       

         

      I send a data from host using the control transfer at Endpoint 0.

         

      I use this CyU3PUsbGetEP0Data to read the data. However, when i send again, it give me error.

         

       

         

      Is it any problem of this?

        • 1. Re: After first data sent in EP0, the second time give error when send again.
          arun.asokan

           Hi,

             

          Can you brief the context and with which return status it is failing ?

          • 2. Re: After first data sent in EP0, the second time give error when send again.
            lim.chong.han

             Hi

               

             

               

            See the Attachments

               

             

               

            I have 3 devices connected, when i click a button, a vendor command via control transfer will sent to each device.

               

            You will see for the first 3 transfer, they are all success. But will i click another button which also another vendor command via control transfer to all device, it cancel out! Then when i click again (click third time), it said "unsuccessful transaction".

               

            This is the code in firmware, i put this in "CyBool_t CyFxLEDtestApplnUSBSetupCB" USB setup CB.

               

            "else if (bType == CY_U3P_USB_VENDOR_RQT)

               

                {

               

                if (wIndex == 0x22)

               

                {

               

                CyU3PUsbFlushEp(0);

               

                CyU3PUsbGetEP0Data(sizeof (buffer), (uint8_t *)buffer, &readcount);

               

                CyU3PUsbAckSetup ();

               

                isHandled = CyTrue;

               

                    }

               

                else if ((wValue == 0x33) && (wIndex == 0x33))

               

                {

               

                CyU3PUsbGetEP0Data(sizeof (buffer), (uint8_t *)buffer, &readcount);

               

                CyU3PUsbAckSetup ();

               

                isHandled = CyTrue;

               

                }

               

                }"

               

             

               

            Why I only can successful to send for the first time?