cancel
Showing results for 
Search instead for 
Did you mean: 

An example where HS USB is used as FS USB at STM32H743

Jimmy_Ma
Associate II

Hi Sir,

We managed to use HS USB port as FS USB on our PCB(there is no external PHY), but our partner  comments that there is no driver available for that purpose. Indeed I only see USB examples for HS USB or FS USB at STM32H7 source tar ball.

 

I believe that there must be such usage. Where can I get the example ?

 

Thanks.

 

Sincerely,

Jimmy 

6 REPLIES 6
MOBEJ
ST Employee

Hello @Jimmy_Ma 

You can find USB examples on GitHub at the following link: STM32CubeH7/Projects/STM32H743I-EVAL/Applications at master · STMicroelectronics/STM32CubeH7 · GitHub.

In the Application section, there are specific examples tailored for the STM32H743 board, including USB Host and USB Device applications. 

br 

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.

Hi @MOBEJ 

Thanks for your prompt reply.

 

However, I did check the STM32H7 repository & tried some application like CDC_standalone:

Jimmy_Ma_0-1758529135970.png

#define USB1_OTG_HS ((USB_OTG_GlobalTypeDef *) USB1_OTG_HS_PERIPH_BASE)

#define USB2_OTG_FS ((USB_OTG_GlobalTypeDef *) USB2_OTG_FS_PERIPH_BASE)

In other words, I am looking for some example with 

#define USB1_OTG_FS ((USB_OTG_GlobalTypeDef *) USB1_OTG_FS_PERIPH_BASE)

 

Please advise. Thanks.

 

Sincerely,

Jimmy

 

 

Pavel A.
Super User

> In other words, I am looking for some example with 

> #define USB1_OTG_FS ((USB_OTG_GlobalTypeDef *) USB1_OTG_FS_PERIPH_BASE)

There are no such examples, because ST have changed the naming convention. USB controllers now are named USB1, USB2 and so on instead of "FS" and "HS". Some of USB controllers are capable of both modes. The actual mode is set somewhere in the initialization code.

 

Hi @Pavel A. @MOBEJ ,

Thanks for the reply.

 

So, I change PHY select for HS USB as below:

Jimmy_Ma_1-1758595030734.png

But the device seems to fail(timeout) when resetting PHY here:

Jimmy_Ma_2-1758595145000.png

 

 

Did we miss any thing else to modify for internal PHY select ?

 

Please advise. Thanks.

 

Jimmy

Pavel A.
Super User

Yes it looks like this. Also watch for other #ifdefs that affect the HS vs FS endpoint size limits  and so on.

 

 

FBL
ST Employee

Hi @Jimmy_Ma 

When building your project, you can choose which USB instance to be used and in which mode 

FBL_0-1758621666361.png

If you would like to use instance USB1_OTG_HS in full speed, you can simply reconfigure here the project to work in FS, make sure to  initialize the interface as follows

hpcd.Init.phy_itface = PCD_PHY_EMBEDDED;

hpcd.Init.speed = PCD_SPEED_FULL;

CN18 should be used for USB Full Speed opereations

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.