Skip to main content
Explorer II
November 6, 2024
Question

No interrupt generated on USB Host for STM32MP135F-DK

  • November 6, 2024
  • 1 reply
  • 1212 views

Hi all,

I'm trying to enable the host functionalities for USB Port1 for MP135: I imported the Host Library and implemented some functions on usbh_conf.c file. Attached to the DK board I have a optic mouse.

After some basic initialization I'm in the USBH_LL_Start() function and I have the following debug outputs:

Before USBCMD, USB_STS, USBINTR, PORTSC1 set:
USBH_LL_Start usbcmd: 0x00080B00; usbsts: 0x00001000
PORTSC1: x00002000
usbINTR enbl: 0x00000007;

Set the Run/Stop bit and wait for !HC_HALTED:
usbcmd: 0x00080B01; usbsts: 0x00000000
try 0: status 0x00000000
usbcmd: 0x00080B01; usbsts: 0x00000000
PORTSC1: x00002000

Set the PORTPOWER bit for PORTSC1:
PORTSC1: x00003000

Set CONFIGFLAG_FLAG:
usbcmd: 0x00080B01; usbsts: 0x00000004
F PORTSC1: x00001803
usbINTR enbl: 0x00000007;

PORTSC1 set Reset + delay
PORTSC1: x00001101

POSTSC1 reset Reset ..
PORTSC1: x00001101
.. wait ..
PORTSC1: x00001005 --> Port Enabled + Device present !
usbcmd: 0x00080B01; usbsts: 0x00000004 --> Port change Detect

In my undestanding these operations should fire usb interrupt(s) but my irq handler routine is never called:

void USBH_PORT1_IRQHandler(void)
{
HAL_HCD_IRQHandler(&hhcd); //
}

 

 The IRQ is enabled by:

 GIC_SetPriority(USBH_PORT1_IRQn, 5);
GIC_EnableIRQ(USBH_PORT1_IRQn); 

 

Is there a reason?

thanks, regards

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 7, 2024

    Hi @SteMMo 

     

    USB Host is not delivered by ST. Can you clarify what you mean by "I imported the Host Library" ?

     

    Thanks 

    Olivier 

     

    SteMMoAuthor
    Explorer II
    November 7, 2024

    Hi @Olivier GALLIEN ,

    I mean that I extracted the Middlewares\ST\STM32_USB_Host_Library\* files and folders from the STM32CubeMP13 SDK archive and added them to my project.

    Thanks,

    regards

    SteMMoAuthor
    Explorer II
    November 8, 2024

    quite incredibly these registers have the same value even if the mouse is NOT connected!

    So why the Device present bit in PORTSC1 is hi?? Is it the external USB hub?

     

    Anyway the VBUS on the USB socket (then mouse led) is low.

    I prayed that the hub were disabled cause the disabled USB port .. but now is enabled ..PORTSC1=0x1005.