Usage of XUD_Manager Topic is solved

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
User avatar
dsteinwe
Active Member
Posts: 52
Joined: Wed Jun 29, 2016 8:59 am

Usage of XUD_Manager

Postby dsteinwe » Thu Jul 30, 2020 6:50 am

Hi,

I have question about the usage of the function "XUD_Manager" of the usb library. The function is documented in the corresponding pdf, but unfortunately some details are missing about the parameters "epTypeTableOut" and "epTypeTableIn". So far, I have understood, that the number of endpoints in the descriptor must match the array size of these parameters. Index 0 is always set to the control endpoint 0. But what is about the other, device specific endpoints, I have defined in the descriptor? Does the order of the endpoints in the descriptor, the defined endpoint address correspond to the index of the array or something totally different? I would expect, that the endpoint address is the right answer.

Am I right, that device specific endpoints must start from endpoint address 1 and 0 is invalid for a device specific endpoint, because it is already in use by the control endpoint 0?
View Solution
User avatar
dsteinwe
Active Member
Posts: 52
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Jul 30, 2020 5:55 pm

I have seen, that not the "endpoint address" but the "endpoint number" is the right term. The difference is, that "endpoint address" contains the "endpoint number" and the direction (IN/OUT) as an additional bit. This wasn't clear to me till now.

The suspicion intensifies that the endpoint number must correspond to the array index. Additionally, the "endpoint number" seems to be continuously, even this is not explicitly defined in the usb spec. For interface numbers, I have found such a requirement.
User avatar
mon2
XCore Legend
Posts: 1815
Joined: Thu Jun 10, 2010 11:43 am

Postby mon2 » Fri Jul 31, 2020 11:30 am

Hi. See if the attached document helps. Took forever to post this due to the continued DDoS server attacks.
You do not have the required permissions to view the files attached to this post.
User avatar
dsteinwe
Active Member
Posts: 52
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Fri Jul 31, 2020 2:49 pm

Hi mon2, thanks for your help. I have checked both documents: "XMOS USB Device (XUD) Library" and "XMOS USB Device Design Guide". Unfortunately, the parameters "epTypeTableOut" and "epTypeTableIn" are not described deeper. In the meanwhile, I have spent a view on the sources of the audio example project. There, I have found the important definitions "USBEndpointNumber_In" and "USBEndpointNumber_Out" in the file "devicedefines.h". These enums corresponds to the definitions in the descriptor ("descriptors.h"). Therefore, I reason, that the endpoint number must correspond to the array index.

The code reveals one more further detail: If you are using a feedback channel, the feedback channel must have the same endpoint number; but the endpoint addresses differs, because the direction of the feedback endpoint is always inverted to the data endpoint. I hope, these insights helps someone else.

BTW, it makes me sad to read, that someone attacks the servers. I hope a solution will soon be found to avert these attacks. Maybe specialized hardware or anti-DDOS services like Akamai, Cloudflare or Link 11 help.
User avatar
dsteinwe
Active Member
Posts: 52
Joined: Wed Jun 29, 2016 8:59 am

Postby dsteinwe » Thu Aug 06, 2020 6:33 pm

Finally, I have also found the corresponding text section that answers my question. I have found it in the "USB Library" manual (https://www.xmos.com/file/lib_usb-userg ... ion=latest):
2.4 Endpoint addresses
Endpoint 0 uses index 0 of both the endpoint type table and the channel array. The address of other endpoints must also correspond to their index in the endpoint table and the channel array.

Who is online

Users browsing this forum: No registered users and 3 guests