AnsweredAssumed Answered

STM32Cube USB Host Driver Interrupt Flood

Question asked by cow.moo on Jan 30, 2016
Latest reply on Oct 19, 2016 by willow.johnny
Hey folks, I've been working on USB host driver for MIDI, and so far I can enumerate the device and get data flowing. But as soon as the device is attached I get crazy numbers of interrupts related to IN transactions. A trace of the USB shows an IN being sent from the STM32 to the connected device about every 3us or so. Each request generates a USB interrupt when the NAK is received. It basically causes the rest of my application to be unresponsive.

A few questions:

- Is there a way to mask these out of the Cube drivers? A quick hack proved that there was some housekeeping that relied on this interrupt.

- Is there a way to slow down the IN requests? I don't need so many per USB frame.

Also a somewhat related question about the overall design of the USB host driver framework: It seems that polling using the BgndProcess callback is the only way to actually transfer data. That would mean that unless I want to run my polling task really fast there would be no way to actually get more bulk transfers per frame anyway, since it has to receive the data and then set up the next transfer.

I guess DMA is possible but the examples all seem to only deal with setting up endpoints and exchanging data on the polling task. Ideally I'd prefer to have a callback that allows me to service each IN request as it arrives, and a way to throttle how fast the IN requests are sent to the device.

Please help, I've been battling this for days!