cancel
Showing results for 
Search instead for 
Did you mean: 

Is STM32F103VET6 not supported to use USART1 and USB simutaneously in self-powered devices?

OW1TY2
Associate II

According to AN4879, PA9 must be used as VBUS Sensing and must not be re-used for other purposes. However, according to CubeMX, PA9 refer to USART1_TX and USART1 is the only port that supports memory reprogramming (STM32F103VET6 Datasheet Section, 2.3.10, "Boot modes")

 

Does it mean that in self-powered devices, USART1 and USB must not be used simultaneously?

 

OW1TY2_0-1705849805434.pngOW1TY2_1-1705849810405.pngOW1TY2_2-1705849812714.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The USB has to be powered down in order to use PA9 as something else:

TDK_0-1705851272935.png

If you boot into the bootloader, USB is not initialized and USART1 can be used with PA9. But within your program, if you have USB running, you can't use USART1 at the same time.

 

Edit: the above is what the reference manual says. CubeMX has no issue with using them both at once. I suspect the RM is correct but don't have a chip to test.

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

View solution in original post

3 REPLIES 3
TDK
Guru

The USB has to be powered down in order to use PA9 as something else:

TDK_0-1705851272935.png

If you boot into the bootloader, USB is not initialized and USART1 can be used with PA9. But within your program, if you have USB running, you can't use USART1 at the same time.

 

Edit: the above is what the reference manual says. CubeMX has no issue with using them both at once. I suspect the RM is correct but don't have a chip to test.

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

It's not necessary to use PA9 for VBUS sensing, you can use any other pin. However, you then have to modify the USB code accordingly.

JW

Hi @OW1TY2 ,

 

indeed on STM32F103 MCU, it is not necessary to use PA9 , any other pin can be re-used as GPIO with a resistor bridge to detect VBus (5 Volts) from USB Host . These series features only Device Mode Full speed .

See this Application Note :

https://www.st.com/resource/en/application_note/an4879-introduction-to-usb-hardware-and-pcb-guidelines-using-stm32-mcus-stmicroelectronics.pdf

IMG_6252.jpeg

 Hope it helps you .

Cheers,

ST1