cancel
Showing results for 
Search instead for 
Did you mean: 

USB detect problem with STM32F205VB

pawburdzy
Associate
Posted on October 07, 2016 at 13:19

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

#usb-detect-problem-stm32-stm32f2
1 REPLY 1
Amel NASRI
ST Employee
Posted on October 28, 2016 at 11:49

Hi burdzy.pawel,

Do you face the same issue using the example provided in the STM32CubeF2 package. You have following HID examples (depending on used board):

- STM32Cube_FW_F2_V1.4.0\Projects\STM322xG_EVAL\Applications\USB_Host\HID_Standalone

- STM32Cube_FW_F2_V1.4.0\Projects\STM32F207ZG-Nucleo\Applications\USB_Host\HID_Standalone

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.