Skip to main content
Visitor II
June 4, 2021
Question

STM32L4 USB polling: Which interrupt line?

  • June 4, 2021
  • 5 replies
  • 1169 views

Hi. I'm having trouble managing a USB slave on STM32L4 using interrupt. I'm able to make it work using polling, and on a previous F3 project, had polling working.

From RM, NVIC section, F3 has 3 USB lines: Wakeup, LP, and HP (HP and LP are shared with CAN). You handle USB requests using the LP line (maybe HP as well; didn't try). On L4, how do I do this, given it doesn't have these lines? Than you.

edit: It looks like G4 uses the same scheme as F3, with line 19 and 20 as the USB LP and HP lines. I tried this on L4 (despite it not being documented), but no luck.

edit: Figured out my code problem: I had to modify the interrupt table, and made some errors there. I'm still curious why we don't have the LP and HP interrupts on L4.

    This topic has been closed for replies.

    5 replies

    Super User
    June 4, 2021

    Which 'L4?

    JW

    DOCon.1Author
    Visitor II
    June 4, 2021

    L443. This should apply to any L4x2 and L4x3.

    Super User
    June 5, 2021

    According to UM0394, USB interrupt goes through EXTI17, so you need to set EXTI properly to trigger interrupt on that line, probably on rising edge.

    JW

    DOCon.1Author
    Visitor II
    June 7, 2021

    Thank you. I've done that; no progress. Note that that line lets you unmask, in EXTI_IMR, but has no RTSR or FTSR fields. (Reserved on L4, although other MCUs have it)

    Any idea what's going on with only having a wakeup interrupt?

    Super User
    June 7, 2021

    No, sorry.

    Try to have a look at CubeL4.

    JW