cancel
Showing results for 
Search instead for 
Did you mean: 

VBus Sensing for self powered USB device using STM32C071CBT6

PPate.1
Associate III

Hi,

I created custom board using STM32C071CBT6 MCU and using USB port in device only mode. I have connected VBuS sensing through potential divider circuit to GPIO PA10 of my controller. My device is self powered. I read some USB related articles from STMicro for other controllers and noticed that for self powered devices VBus sensing is mandatory and should be connected to PA9 as this pin has internal functionality of VBus sensing.

In my configuration I have disabled VBus sensing. However, my device is getting detected by host.

Do I have to enable VBus sensing as my device is self powered? If yes, then how it will impact functionality?

Should it be connected to PA9 for STM32C0xx also? Can I use PA10 with some code modifications, as my hardware is already developed?

I checked datasheet and reference manual of this MCU and could not find any reference of VBuS sensing through PA9.

Thanks,

Pradeep

 

3 REPLIES 3
FBL
ST Employee

Hi @PPate.1 

According to C071 nucleo schematics, PC0 is used for vbus sensing.

FBL_1-1744225914812.png

 

This post should be helpful Details of using USB without VBUS sensing - STMicroelectronics Community

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.


PPate.1
Associate III

Hi @FBL,

C071 Nucleo has STM31C071RBT6 chip which is a 64 pin chip. This has PC0 pin. I am using STM32C071CBT6 chip which is 48 pin chip and it does not have PC0 pin.

PPate1_0-1744384682728.png

Thanks,

Pradeep

FBL
ST Employee

My bad @PPate.1  Indeed PC0 is not available on STM32C071CBT6.
So as long you configure PA10 properly as Input and implement USB sensing logic in your firmware, also configure SYSCFG_CFGR1 register properly because pins PA9 and PA10 can be remapped in place of pins PA11 and PA12
it should work!

> about your question : How will it impact USB functionality if VBUS sensing is not enabled?

  1. Disabling VBUS sensing can lead to non-compliance with the USB specification, as the device may keep the DP pull-up enabled when VBUS is removed.
  2. The device may not properly detect when the USB cable is removed, leading to potential issues with the device's state management (e.g., incorrectly handling suspend and resume events and unable to reconnect unless you reset the MCU).
  3. There is a risk of current flowing into the USB host through the pull-up resistor when VBUS is not present, which can cause unintended behavior/damage.

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.