Implement a USB device interface descriptor constituted with a Bulk-In and an Interrupt-In endpoint with STM32Cube USB Device Library
Dear Sirs,
Can I use STM32Bube USB device library to implemet USB interface descriptor contains both a Bulk-In endpoint and an Interrupt-In endpoint? The function of these 2 endpoints are listed:
- Bulk-In endpoint is used to dump device status while receiving our proprietary commands via control transfer (the Endpoint 0) from the connected USB host.
- Interrupt-In endpointis used to notify the connected USB host actively while certain device status is just changed.
To simplify the USB device firmware and the driver for our implement, I didn't declare 2 or more USB interfaces to carry each of these endpoints with different type like how the most of the USB composite device does, but declare only one interface with Vendor-Specific class/sub-class/protocol code(0xFF) in device descriptor.
But we found it is NOT working after implement the firmware on STM32F411E-DISCO board. Always only one of these 2 endpoint will be functional depend on which of their endpoint number is the first. For example:
- If I declare Endpoint Address of Bulk-In endpoint as 0x81 and Interrupt-In endpoint as 0x82, then only Bulk-In endpoint is functional.
- Vice Versa, declaring Endpoint Address of Bulk-In endpoint as 0x82 and Interrupt-In endpoint as 0x81, then only Interrupt-In endpoint is functional.
I install WinUSB to serve as the driver of this customized device, and invoke APIs of LibUSB to make Bulk-Transfer(libusb_bulk_transfer) and Interrupt-Transfer(libusb_fill_interrupt_transfer, libusb_submit_transfer, libusb_handle_events) to the corresponded endpoint. in the case of NOT functional, These APIs just end-up with time-out without capturing any data feedbacked MCU.
Since I can use USBview or USB Device Tree View on USB host to see all these 2 endpoints are enumberated correctly, and if I replace the Interrupt-In endpoint with Bulk-Out endpoint, all the 2 enpoint works correctly. For now, I don't think I have syntax error in my USB device descriptor that limit only one endpoint to be functional.
I didn't find any description in USB 2.0 spec related to USB device interface/endpoint mention about an interface descriptor can't implement multiple endpoints with the same (IN/OUT) direction or different transferring type. So currently I still can't figure out why it is not working and stucking here :(
