TeenyUSB
TeenyUSB copied to clipboard
Interrupt out pipe toggle bit does not change
When using tusb_host_xfer_data on a interrupt endpoint only the first packet is registered by my USB device. Subsequent packets are ignored.
The hc->toggle_out variable is never toggled by tusb_otg_out_channel_handler . Interrupt endpoints should behave the same as bulk endpoints in this regard.
The below code should also check HCCHAR_INTR and toggle the toggle_out bit.
https://github.com/xtoolbox/TeenyUSB/blob/303431c66cc6f31935d090c5269550f31d49a351/usb_stack/src/teeny_usb_stm32_otg_host.c#L602-L604
I changed it to this which resolved my issue.
if(HcEpType == HCCHAR_BULK || HcEpType == HCCHAR_INTR){
hc->toggle_out ^= 1U;
}
Reference: https://books.google.com.au/books?id=pkefBgAAQBAJ&lpg=PA52&ots=6_nyePBwxH&dq=interrupt%20endpoint%20toggle%20bits&pg=PA52#v=onepage&q&f=false