9 Replies Latest reply on Feb 11, 2019 12:34 AM by abhinavg_21

    CyBulkEndPoint

    rasec_2385561

      I have been working with the BulkLoop sample application from your website. I am trying to get it to work with the firmware

      settings from AN56377 project 1. Currently I am having an issue with the ConstructEndpoints() function. What I am seeing

      is that the lines:

       

                  outEndpoint = loopDevice.EndPointOf(addrOut) as CyBulkEndPoint;
                  inEndpoint = loopDevice.EndPointOf(addrIn) as CyBulkEndPoint;

       

      produce null outputs for inputs of

      addrOut =  0x04

      addrIn = 0x83

       

      which are the settings for the AN56377 project 1. So the question is why is the function returning a null value ?

      Any ideas ?

        • 1. Re: CyBulkEndPoint
          abhinavg_21

          Hi Randy,

           

          Please mention which board are you using? Is it FX3 or PSOC? Could you please share the snippet of code of Host application where these instructions are mentioned.

           

          Thanks & Regards
          Abhinav

          • 2. Re: CyBulkEndPoint
            rasec_2385561

            This board is a PSOC 5LP Prototyping Kit.

             

               private void ConstructEndpoints()
                {
                    if (loopDevice != null && cboOutEndPoint.Items.Count > 0 && cboINEndpoint.Items.Count > 0)
                    {
                      
                        string sAltOut = cboOutEndPoint.Text.Substring(4, 1);
                        byte outAltInferface = Convert.ToByte(sAltOut);

             

                        string sAltIn = cboINEndpoint.Text.Substring(4, 1);
                        byte inAltInferface = Convert.ToByte(sAltIn);

             

                        if (outAltInferface != inAltInferface)
                        {
                            Text = "Output Endpoint and Input Endpoint should present in the same ALT interface";
                            StartBtn.Enabled = false;
                            return;
                        }

             

                        // Get the endpoint
                        int aX = cboINEndpoint.Text.LastIndexOf("0x");
                        string sAddr = cboINEndpoint.Text.Substring(aX, 4);
                        byte addrIn = (byte)Util.HexToInt(sAddr);

             

                        aX = cboOutEndPoint.Text.LastIndexOf("0x");
                        sAddr = cboOutEndPoint.Text.Substring(aX, 4);
                        byte addrOut = (byte)Util.HexToInt(sAddr);
                        // OUT endpoint to be 0x02 and IN endpoint to be 0x86
                        outEndpoint = loopDevice.EndPointOf(addrOut) as CyBulkEndPoint;
                        inEndpoint = loopDevice.EndPointOf(addrIn) as CyBulkEndPoint;
                      
                        if ((outEndpoint != null) && (inEndpoint != null))
                        {
                            //make sure that the device configuration doesn't contain the other than bulk endpoint
                            if ((outEndpoint.Attributes & 0x03/*0,1 bit for type of transfer*/) != 0x02/*Bulk endpoint*/)
                            {
                                Text = "Device Configuration mismatch";
                                StartBtn.Enabled = false;
                                return;

             

                            }
                            if ((inEndpoint.Attributes & 0x03) != 0x02)
                            {
                                Text = "Device Configuration mismatch";
                                StartBtn.Enabled = false;
                                return;
                            }
                            outEndpoint.TimeOut = 1000;
                            inEndpoint.TimeOut = 1000;
                        }
                        else
                        {

             

                            Text = "Device Configuration mismatch";
                            StartBtn.Enabled = false;
                            return;
                        }

             

                    }
                }
            • 3. Re: CyBulkEndPoint
              abhinavg_21

              Please check the device manager if the device is enumerating properly. Also share the screen shot of it.

               

               

              Thanks & Regards
              Abhinav

              • 4. Re: CyBulkEndPoint
                rasec_2385561

                The device driver appears to be operating properly.

                 

                Randy

                 

                 

                loopback problem.png

                 

                PS: I wondered if the order of the endpoints would make any difference ? The bulk endpoints are after

                the interrupt endpoints.

                • 5. Re: CyBulkEndPoint
                  abhinavg_21

                  Hi Randy Seedle,

                   

                  Are you able to see the device in control center? Also tell me what is the driver version it is binding to?

                   

                  Thanks & Regards
                  Abhinav Garg

                  • 6. Re: CyBulkEndPoint
                    rasec_2385561

                    I rewrote the the firmware and this problem went away. So now we are on to

                    the next bug.

                    • 7. Re: CyBulkEndPoint
                      abhinavg_21

                      Hi Randy,

                       

                      Could you please mention what changes you made in new firmware?

                       

                      Thanks & Regards
                      Abhinav Garg

                      • 8. Re: CyBulkEndPoint
                        rasec_2385561

                        Basically what I changed in the AN56377 firmware was:

                         

                        1. I moved the bulk endpoints to the first configuration spots and the Int endpoints to the second configuration spots.

                        2. I removed the isochronous endpoints.

                         

                        My belief was that the bulk loopback sample application was not able to find the bulk endpoints for some reason.

                        And I was not going to use the isochronous endpoints.

                        • 9. Re: CyBulkEndPoint
                          abhinavg_21

                          Okay, Thanks for sharing.