cancel
Showing results for 
Search instead for 
Did you mean: 

USB Host PROBLEM usb power led off when I run application

Uusta.1
Associate III

Hello all !

I try to develop some usb host application. Just for a test, I write simple code. In usb_host.c file

under static void USBH_UserProcess (USBH_HandleTypeDef *phost, uint8_t id) function

case HOST_USER_DISCONNECTION:
  Appli_state = APPLICATION_DISCONNECT;
  HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_RESET);
  break;
 
  case HOST_USER_CLASS_ACTIVE:
  Appli_state = APPLICATION_READY;
  HAL_GPIO_WritePin(LED_GPIO_Port,LED_Pin,GPIO_PIN_SET);
  break;

When I insert my usb disk, I expected to see my on board led to be on and when I remove my usb disk, my board led will be off. But it doesn't work and I realized LD7 (usb power led) is being off small amount of time after I run the code. You can see my cubemx configuration and STM32F4DISCOVERY OTG schematic on below. I'm pretty sure that I correctly selected everything to run this app. USB_HOST library created by Cube MX, What could be wrong?? My Firmware package version FW_F4 V1.26.2 on cube mx0693W00000JQAesQAH.png0693W00000JQAfWQAX.png0693W00000JQAflQAH.png0693W00000JQAgFQAX.png0693W00000JQAg0QAH.png

1 REPLY 1

Hello @Uusta.1​ ,

You can refer to the following example provided under the F4 Firmware Package:

  • Projects\STM32469I-Discovery\Applications\USB_Host\MSC_Standalone

I hope this helps you.

BeST Regards,

Walid