Usage of XUD_Manager Topic is solved

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Usage of XUD_Manager

Post by dsteinwe »

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
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

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: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

Hi. See if the attached document helps. Took forever to post this due to the continued DDoS server attacks.
Attachments
XMOS-USB-Device-Design-Guide-_documentation_1.2.2rc4.a.pdf
(389.49 KiB) Downloaded 121 times
User avatar
dsteinwe
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

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
XCore Addict
Posts: 144
Joined: Wed Jun 29, 2016 8:59 am

Post by dsteinwe »

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.
Post Reply