Questions:How to manage ISOCH endpoints that set the Synchronization Type or Usage Type to anything except 00 in the bmAttributes field of the endpoint descriptor?If I set any other bits in the bmAttributes field besides bits 1:0, I do not get endpoint descriptors back correctly. I'm having ISOC problems when using the Synchronization Type or Usage Type in my endpoint descriptors, how do I correct this?
Response:If operating EZ-Host or EZ-OTG in peripheral mode and the peripheral is configured for ISOCHRONOUS endpoints you may see this problem. For an ISOCHRONOUS endpoint, if the bmAttributes field in the Endpoint Descriptor is using bits 5..2, which is valid, the BIOS will not correctly parse the endpoint and set up the part correctly for ISO transfers.
There are two ways to address this issue. One method is to mask these bits before the BIOS parses the descriptors. Since there will be multiple interfaces with an ISOCH solution, you can mask the bmAttributes in the SET_INTERFACE handler. This is actually demonstrated in the application note titled: Using Multiple Interfaces to Implement a USB Isochronous Composite Peripheral with EZ-Host(TM) and EZ-OTG(TM) - AN5083. An alternate solution would be to replace the BIOS delta config interrupt and modify the USB_parse code to mask off all but the lower two bits of the bmAttribute (for bEPAttribute). A copy of the BIOS source code can be requested from Cypress Technical support. A possible solution in the BIOS code might look like this:
Currently in the BIOS USB_parse you will find this:
@@: cmp b[r8+bEPAttribute],1 ; check ISO
or r2, EP_ISO
The cmp statement checks to see if the bEPAttribute equals 1. To resolve this issue, you can check that only the lower two bits equal 01b and ignore the upper bits. Your code could look something like this:
@@: test b[r8+bEPAttrigute], 0x01 ; check ISO
test b[r8+bEPAttribute], 0x02
; if we get here, then the lower two bits of bEPAttribute = 01 meaning it is ISO