cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L432KC USB VBUS Sensing

Henri1
Associate

Hello,

I'm currently working on a self-powered project that uses an STM32L432KC. From reading AN4879 I see that I have to enable VBUS sensing because it is mandatory for self-powered USB devices. Using CubeMX, I cannot enable VBUS sensing for the MCU. Is there an application note or reference implementation on how to proceed? Can I integrate VBUS sensing into the Cube Middleware for any Pin of the MCU?

0690X0000089iOgQAI.png

Best regards

Henri

4 REPLIES 4
Imen.D
ST Employee

Hello,

You can refer to this FAQ " Management of VBUS sensing for USB device design" which helps you on manage of VBUS sensing.

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Henri1
Associate

Hey,

thanks for the quick response! However, I have seen that FAQ and am still uncertain. Does the STM32L432KC have a dedicated VBUS sensing pin (As CubeMX doesn't show that option)? And if it doesn't the paragraph: "2. Solution without usage of a dedicated VBUS pin

Any 5V tolerant pin with external interrupt functionality can be used with an external resistor divider, to fulfill AMR conditions. In this case, recommended values are 2x100 kOhms .

However the disadvantage of this solution is that the software handling of VBUS presence event needs to be implemented by the customer, since this is not managed within our STM32 USB library for the time being." doesn't really give me any confidence on how to implement the functionality.

Regards

Henri

Imen.D
ST Employee

Hi,

It seems STM32L432KC does not support USB_OTG_FS and VBUS Sensing.

In case, you choose another MCU with similar feature of STM32L432 and with USB_OTG_FS, you can enable USB_OTG_FS in STM32CubeMX, choose Host_Only mode, then activate VBUS sensing (see screenshot below).

0690X0000089r1vQAA.jpg

Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

Hi Imen,

Can I activate the vbus if my microcontroller is in a device only mode? Thanks