Skip to main content
Graduate II
March 27, 2024
Solved

USB FS Support

  • March 27, 2024
  • 2 replies
  • 1315 views

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

    This topic has been closed for replies.
    Best answer by FBL

    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.

    2 replies

    Technical Moderator
    April 1, 2024

    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?

     

    ShikamaruAuthor
    Graduate II
    April 1, 2024

    Jumper on CN3 is connected to stlink.  

    FBLAnswer
    Technical Moderator
    April 3, 2024

    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.

    ShikamaruAuthor
    Graduate II
    April 4, 2024

    Thanks @FBL ,

                               I will give it a try and let you know !