Hello, I need to create a USB vendor specific device communicating only via a control endpoint 0. No additional endpoints should be defined and used. Is this possible? How can I handle callbacks?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hello, I need to create a USB vendor specific device communicating only via a control endpoint 0. No additional endpoints should be defined and used. Is this possible? How can I handle callbacks?
Hi,
Yes, In theory, I think it is possible. However, we don't have an example that setup only for control transfers with endpoint 0. Per USB standard, all USB devices must at least support control transfers using endpoint 0. TivaWare examples are written for various USB classes such as bulk, HID, CDC. These class dependent examples will make use of other type of transfers like interrupt and bulk using more endpoints in addition to the control transfers. I will suggest you refer to TivaWare USB examples and perhaps modify them to remove the things that are not needed for your application. You can find USB examples in directory C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl
Hi,
yes, that is exactly what I did. I started with generic bulk device example which uses Vendor Specific Device class and 2 additional endpoints, which should of course be removed. According to the USB specification, the control transfer is initiated by a host setup transaction, followed by several data transactions and ended by a status transaction. The data transaction can transfer even a vendor specific data. How are this data transmitted and received by the device, which callbacks are called, ... when no additional endpoints are defined.
Hi,
According to the USB specification, the control transfer is initiated by a host setup transaction, followed by several data transactions and ended by a status transaction.
I think this all handled internally by the USB drivers. I'm not really an USB expert but below is what I found by digging into the code. Below is the sequence of operations.
1. When the host sends a standard request during enumeration, that becomes an interrupt to the USB module.
2. The interrupt will call USBDeviceIntHandlerInternal(). Read usbdenum.c
3. USBDeviceIntHandlerInternal() will then call USBDeviceEnumHandler() to handle endpoint 0 interrupts.
4. USBDeviceEnumHandler() will call USBReadAndDispatchRequest() to process newly arrive packet.
5. Let's say the standard request from USB host is GET_DESCRIPTOR, it will jump to the USBDGetDescriptor() function that is defined in the g_psUSBDStdRequests[] jump table.
6. In USBDGetDescriptor() the device will return all the descriptors to the host.
With the above said, the TivaWare USB library only handles the standard host requests like GET_DESCRIPTOR, GET_STATUS and etc using endpoint0 during enumeration. In another word, it is not for transferring user/functional data. At least that is not how USB library is designed and I don't see the hooks to extend for custom functions. As you can see from usb_dev_bulk.c example, the functional data transfer will use other endpoints that will be handled in class specific requests. I'm not sure what your application is. You maybe better off to use the usb_dev_bulk.c transfer. If you still want to only do transfers on endpoint0 using control transfers, I think you will need to customize the USB library and that will be on your own. Sorry.