cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H743XGH6 USB VBUS

NiM
Associate III

I want to use port PA9 of STM32H743XGH6 as “FS_VBUS”.

In this case, which number should I put in the target register for the alternate function?

I understand that if I use CubeMX, it will set it automatically.

6 REPLIES 6
TDK
Guru

It does not correspond to an AF. It is an "additional function" which will be active when it's configured within the USB registers. It hijacks the pin.

TDK_0-1745412146545.png

Probably from the VBDEN bit:

TDK_1-1745412406581.png

 

Kind of like the PH0/PH1 pins--they have HSE functionality regardless of the GPIO configuration when HSE is enabled.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @NiM 

Since VBUS sensing is defined as additional function, it should be left at its default state (analog mode). So, you should configure PA9 as an input with no pull-up or pull-down resistors, and ensure it is in analog mode.

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.


@FBL 

> Since VBUS sensing is defined as additional function, it should be left at its default state (analog floating input).

Is this documented anywhere? Where? I've looked, maybe I've missed it.

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Hi @TDK 

I think It is not explicitly mentioned in all datasheets. See page 224

FBL_1-1745508160733.png

 

 

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. It should probably be changed to say

 

... default state (analog), not as alternate....

 

Since input mode is different than analog mode and saying "floating input" to mean "analog" is misleading.

TDK_0-1745510961356.png

 

If you feel a post has answered your question, please click "Accept as Solution".
FBL
ST Employee

Apologies for the confusion @TDK. I forgot about this. For STM32H743, as per RM0433, the VBUS sense pin should remain in its default analog mode. In contrast, for STM32F411, the default state is input mode. The pin should be left unconfigured to allow sensing, as additional functions are directly managed through peripheral registers and should remain at their reset values.

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.