Skip to main content
Visitor II
April 23, 2020
Question

Does USB library work under heavy interrupt load?

  • April 23, 2020
  • 2 replies
  • 780 views

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.

    2 replies

    Visitor II
    April 23, 2020

    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:

    Super User
    April 23, 2020

    > 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.

    Visitor II
    April 23, 2020

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