AnsweredAssumed Answered

HALT management in USB stack

Question asked by Luca Giuliodori on Dec 19, 2017
Branched from an earlier discussion
Looking in the internet I found this webpage that say: "Typically, the STALL handshake indicates a functional stall. A functional stall occurs when the halt feature (which will be covered under "USB Framework") of an endpoint is set. In this circumstance, host intervention is required via the default control pipe to clear the halt feature of the halted endpoint."
I don't know if it is the solution but in my opinion the ST's USB stack doesn't do nothing when halt feture accours.
In addition in the file "stm32f4xx_II_usb.c", in the "USB_HC_StartXfer" function, at line 1596, the code sould be "is_oddframe = (USBx_HOST->HFNUM & 0x01) ? 1 : 0;" instead of "is_oddframe = (USBx_HOST->HFNUM & 0x01) ? 0 : 1;" and, in accord with reference manual, the MCNT bits of OTG_HCCHAR register, should be at value "01" and not "00" ( 00: Reserved. This field yields undefined results).
I have tried to fix these but the problems persist but I'm not sure there aren't other bugs.
I hope to solve this problems