2017-10-18 06:35 AM
I wonder if someone could help me with proper shutdown and restart of a bulk HOST IN USB endpoint. I am using an STM32469I, with HS USB via ULPI. I can start USB streaming to the host, but at termination I get many spurious Tx interrupts on the endpoint.
I've tried using USBD_LL_OpenEP and USBD_LL_CloseEP, but after the close the endpoint does not work properly.
I've tried using
USBD_LL_OpenEP, and then to stop just disabling the endpoint interrupt in DAINTMSK. This works in some cases, but seems to lead to race conditions and so is unreliable. There must be a better way.
2017-10-19 12:17 PM
I resolved the issue. The main problem was that the peripheral that I was streaming had higher interrupt priority than the USB interrupt, and I was calling bulk streaming functions from the peripheral interrupt. This was damaging USB data structures. I turned off interrupt pre-emption and the problem was solved.