cancel
Showing results for 
Search instead for 
Did you mean: 

USB FS Support

Shikamaru
Associate III

I am working on OTG FS application on stm32f769 discovery board, as per the it's schematic for OTG_FS VBUS power supply will be taken care by External Phy(see below image).

Shikamaru_0-1711460081875.png

 

So as per that I configure the STMCUBE IDE, and i disabled the VBUS_Sensing also. and started the debug process. I noticed that it is getting failed. Inside this USBH_Process in 1st switch case i.e. HOST_IDLE case there is one if condition, that is getting failed. 

 

 

USBH_StatusTypeDef USBH_Process(USBH_HandleTypeDef *phost)
{
  __IO USBH_StatusTypeDef status = USBH_FAIL;
  uint8_t idx = 0U;

  printf("inside usbh process\n");
  /* check for Host pending port disconnect event */
  if (phost->device.is_disconnected == 1U)
  {
    phost->gState = HOST_DEV_DISCONNECTED;
  }

  switch (phost->gState)
  {
    case HOST_IDLE :

      if ((phost->device.is_connected) != 0U)
      {
        printf("USB Device Connected");

        /* Wait for 200 ms after connection */
        phost->gState = HOST_DEV_WAIT_FOR_ATTACHMENT;
        USBH_Delay(200U);
        (void)USBH_LL_ResetPort(phost);

        /* Make sure to start with Default address */
        phost->device.address = USBH_ADDRESS_DEFAULT;
        phost->Timeout = 0U;

#if (USBH_USE_OS == 1U)
        phost->os_msg = (uint32_t)USBH_PORT_EVENT;
#if (osCMSIS < 0x20000U)
        (void)osMessagePut(phost->os_event, phost->os_msg, 0U);
#else
        (void)osMessageQueuePut(phost->os_event, &phost->os_msg, 0U, 0U);
#endif
#endif
      }
      break;

 

 

 Is it related to VBUS ? even i tried by enabling Vbus_Sensing and kept the PA9 gpio which enabled automatically after enabling VBUS sensing still same issue. Can anybody tell me anything am missing here. 

 

 

Regards,

Shikamaru

1 ACCEPTED SOLUTION

Accepted Solutions
FBL
ST Employee

Hello @Shikamaru 

You should connect the jumper usbhs in CN3. It is necessary for ULPI interface

In datasheet section Driving External Vbus, CPEN is dedicated to controlling the Vbus supply when configured as an A-Device (host). 

It is mentioned in the user manual, 32F769IDISCOVERY Discovery board must be powered by an external power supply when using the host function.

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.

View solution in original post

4 REPLIES 4
FBL
ST Employee

Hello @Shikamaru 


@Shikamaru wrote:

I am working on OTG FS application on stm32f769 discovery board, as per the it's schematic for OTG_FS VBUS power supply will be taken care by External Phy(see below image).


USB power switch is connected to VBUS and provides power to CN15 when stm32f769 is Host. However, VBUS is powered by another USB host when F769 is device.

Would you please share the state of jumper usbhs in CN3?

 

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.

Jumper on CN3 is connected to stlink.  

FBL
ST Employee

Hello @Shikamaru 

You should connect the jumper usbhs in CN3. It is necessary for ULPI interface

In datasheet section Driving External Vbus, CPEN is dedicated to controlling the Vbus supply when configured as an A-Device (host). 

It is mentioned in the user manual, 32F769IDISCOVERY Discovery board must be powered by an external power supply when using the host function.

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.

Thanks @FBL ,

                           I will give it a try and let you know !