AnsweredAssumed Answered

USB detect problem with STM32F205VB

Question asked by burdzy.pawel on Oct 7, 2016
Latest reply on Oct 28, 2016 by Amel N
Hi,

I got problem with detecting USB device in host mode after turn on my device. It should fire "interrupt"... but this doesn't happen... don't know why?. If I plug USB device after 1-2 second after turn on it fire interrupt and everything works fine. 

My program looks similar to:
int main(void) {
     HAL_Init();
     
     /* Configure the system clock to 120 MHz */
     SystemClock_Config();

     /* Init Host Library */
     USBH_Init(&USBH_Host, USBH_UserProcess, USBH_ParseDescripor, USBH_ReceivedData, 0);
     /* Add Supported Class */
     USBH_RegisterClass(&USBH_Host, USBH_HID_CLASS);       
     /* Start Host Process */
     USBH_Start(&USBH_Host);
     
     /* Run Application (Interrupt mode) */     
     LOG("Run application...\n");
     
     while (1) {
          USBH_Process(&USBH_Host);
          HAL_Delay(1);
     }
}

of course it is only part of program... but nothing else is configured after USBH_Start().

my interrupt handler looks like this:

void OTG_HS_IRQHandler(void) {
     HAL_HCD_IRQHandler(&hhcd);
}

I use HS mode on this port, FS is supported by USB device. Even if turn off everything else from code (USB FS) or any other things...    it behaves exactly same way.

I will be thanksful if someone could help me!

Thanks in advance.
Pawel





Outcomes