How to add an endpoint in FX3 firmware

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

cross mob
Mrzh_331041
Level 2
Level 2
First like received

In the slavefifosync example code, 2 endpoints are initialized.The device is enumerated as this:

pastedImage_1.png

I want to know how to add another endpoint to the tree. Can anybody provide some examples about endpoint operation or just give me an example with 3 or 4 endpoints.So I can compare the initialization code and the discriptor between them.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

You can add up to 32 endpoints in the descriptor file (cyfxslfifousbdscr.c). When new endpoints are added to the dscr.c file the total length field in the configuration descriptor must be changed accordingly. Also the number of interfaces in the interface descriptors must be changed.

Please refer to the attached project in which 2 more end points are added in the descriptor file(cyfxslfifousbdscr.c) and the endpoints are configured in the cyfxslfifosync.c file under CyFxSlFifoApplnStart() function.

The super speed configuration descriptors total length is modified to 0x46,0x00 (which includes the 2 new endpoint descriptors' lengths) and also the number of endpoints field in the interface descriptor is changed to 4.

Please refer to this https://www.beyondlogic.org/usbnutshell/usb5.shtml#EndpointDescriptors  for more details on endpoint and other USB descriptors.

Best Regards,

Yatheesh

View solution in original post

0 Likes
8 Replies
lock attach
Attachments are accessible only for community members.
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

You can add up to 32 endpoints in the descriptor file (cyfxslfifousbdscr.c). When new endpoints are added to the dscr.c file the total length field in the configuration descriptor must be changed accordingly. Also the number of interfaces in the interface descriptors must be changed.

Please refer to the attached project in which 2 more end points are added in the descriptor file(cyfxslfifousbdscr.c) and the endpoints are configured in the cyfxslfifosync.c file under CyFxSlFifoApplnStart() function.

The super speed configuration descriptors total length is modified to 0x46,0x00 (which includes the 2 new endpoint descriptors' lengths) and also the number of endpoints field in the interface descriptor is changed to 4.

Please refer to this https://www.beyondlogic.org/usbnutshell/usb5.shtml#EndpointDescriptors  for more details on endpoint and other USB descriptors.

Best Regards,

Yatheesh

0 Likes
lock attach
Attachments are accessible only for community members.

Hello,

I have already know how to modify the descriptor and code in CyFxSlFifoApplnStart() to add endpoints now.

But it seems that I didn't create the DMA channel correctly, in the code attatched, the ep 0x01 and 0x81 can transfer data correctly, but the new channel ep 0x82 can not work.

Please help me check what's wrong in the code.

Thank you,

Best Regards

Liu

0 Likes

Hello,

I can transfer data via the new channel now,turns out that I posted a wrong P socket address in the test earlier.

I gave address of 0x10 earlier, transfer failed, then I tried 0x01,transfer successed.

I am a little confused now. I enabled PIB socket like this:

pastedImage_0.png

I thought the address for CY_U3P_PIB_SOCKET_2 should be 0x10 ,which was wrong, the right address is 0x01.

why is that?

Best regards,

Liu

0 Likes

Hello,

The Thread addressing is A1:A0 format i.e for addressing thread 2, A1 should be 1 and A0 should be 0. Please make sure this condition is met.

Thanks,

Yatheesh

0 Likes

Hello,

I think I have followed procedures as you specified.

I give socket address 0x00 in FPGA, monitor flaga,and bulk data in from ep81, the transmission is correct.

Then I give socket address 0x01,monitor flagc, bulk data in from ep82, the transmission is correct.

All other configuration can not achieve data transmission.

The firmware is exactly the one attached in last letter.Here are some information about the FPGA configuration . Please help me find the problem.

pastedImage_0.png

pastedImage_1.png

pastedImage_2.png

pastedImage_4.png

pastedImage_5.png

pastedImage_6.png

pastedImage_7.png

pastedImage_8.png

0 Likes

Hello,

Can you please probe the address lines from the FX3 and check externally if the A1 = high and A0 = low, when thread 2 is supposed to be  selected/addressed.

Thanks,

Yatheesh

0 Likes

Hello,

It's a little difficult to probe the address lines, One of them is layout in inner plane, and none of them has a test point.

I will try and let you know if I succeed.

0 Likes

Hello,

The thread addressing is in A1:A0 format. So, when addressing thread 2. A1 = 1 and A0 = 0. Please check the mapping and values and confirm the same.

Thanks,

Yatheesh

0 Likes