Skip to main content
Lars Beiderbecke
Senior III
Apr 23, 2020 2:09 PM UTC
Question

Does USB library work under heavy interrupt load?

I'm implementing a USB Host (HID Class) on a STM32F7 in order to connect a mouse.

The problem is that in about 50% of cases, phost->gState ends up in HOST_ABORT_STATE, where exactly I do not know. If this does not happen, my user function USBH_HID_EventCallback() is never called more than once.

What is special about my setting is that I have external interrupts enabled, which trigger about every half microsecond when under load. The STM32 keeps up with that, but I wonder if those interrupts might interfere with the USB library, especially the low-level parts dealing with signals.

Does anybody have any insights on how the USB library deals with interrupts? Will it disable interrupts for critical sections? Is there a recommendation how often USBH_Process() should be called?

This topic has been closed for replies.

3 replies

Lars Beiderbecke
Senior III
Apr 23, 2020 2:42 PM UTC

I've just tested with external interrupts disabled, but I still get HOST_ABORT_STATE. So at least in this case, interrupts are not the cause.

I guess I'll withdraw my question. :smiling_face_with_smiling_eyes:

TDK
Apr 23, 2020 3:01 PM UTC

> I have external interrupts enabled, which trigger about every half microsecond when under load.

Interrupts at 2MHz are likely to cause all sorts of problems, if the chip can even keep up.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Lars Beiderbecke
Senior III
Apr 23, 2020 3:04 PM UTC

No, that's working perfectly fine at 200 MHz system clock. The system is about 40% idle at max IR load.