cancel
Showing results for 
Search instead for 
Did you mean: 

Proper Bulk HOST IN USB Endpoint Shutdown

Bill Finger
Associate III
Posted on October 18, 2017 at 15:35

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.

1 REPLY 1
Bill Finger
Associate III
Posted on October 19, 2017 at 21:17

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.