Skip to main content
bobert
Associate II
Mar 2, 2019 8:01 AM UTC
Solved

STM32F730Z8 USB failure with generated code

I just designed a board with the new STM32F730Z8 value line with embedded USB high speed PHY. I'm using a 16MHz external crystal and I am using the default code generated with CubeMX. It fails in the USBD_Init function. Following it through at first glance I found that in usbd_conf.c there is this line:

hpcd_USB_OTG_HS.Init.phy_itface = USB_OTG_ULPI_PHY;

I changed the interface to USB_OTG_HS_EMBEDDED_PHY but it still fails. I imagine there could be some other settings that may be wrong as well. Any guidance on this?

This topic has been closed for replies.
bobert
bobertBest answer
Associate II
Mar 4, 2019 4:44 PM UTC

@Khouloud ZEMMELI​ 

I confirmed there is a problem. I created a new project for the STM32F723ZE and it ran on the F730.

Diffing the files shows two places it is different, the first was the USB_OTG_HS_EMBEDDED_PHY as listed above, and it also included:

__HAL_RCC_OTGPHYC_CLK_ENABLE();

in the HAL_PCD_MspInit function. Making those two changes allows the MX_USB_Init function to succeed. I can see the device connect to my computer but it has an error message. I think this particular problem is solved.

3 replies

Khouloud ZEMMELI
ST Employee
Mar 4, 2019 10:32 AM UTC

​Hello @bobert​ 

Thank you for the feedback.

Can you please share your ioc file ?

Regards,

Khouloud.

bobert
bobertAuthorBest answer
Associate II
Mar 4, 2019 4:44 PM UTC

@Khouloud ZEMMELI​ 

I confirmed there is a problem. I created a new project for the STM32F723ZE and it ran on the F730.

Diffing the files shows two places it is different, the first was the USB_OTG_HS_EMBEDDED_PHY as listed above, and it also included:

__HAL_RCC_OTGPHYC_CLK_ENABLE();

in the HAL_PCD_MspInit function. Making those two changes allows the MX_USB_Init function to succeed. I can see the device connect to my computer but it has an error message. I think this particular problem is solved.

bobert
bobertAuthor
Associate II
Mar 4, 2019 11:32 AM UTC

I have included the ioc file.

Since switching the interface to USB_OTG_HS_EMBEDDED_PHY it fails due to a timeout waiting for the internal LDO to be enabled.