CyBulkEndPoint

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
rasec_2385561
Level 4
Level 4
First like received

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 ?

0 Likes
1 Solution

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.

View solution in original post

0 Likes
9 Replies
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

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

0 Likes

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;
            }

        }
    }
0 Likes

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

Thanks & Regards
Abhinav

0 Likes

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.

0 Likes

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

0 Likes

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

the next bug.

0 Likes

Hi Randy,

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

Thanks & Regards
Abhinav Garg

0 Likes

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.

0 Likes

Okay, Thanks for sharing.

0 Likes