2019-04-02 07:52 AM
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?
Best regards
Henri
2019-04-02 08:23 AM
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
2019-04-02 08:27 AM
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
2019-04-03 08:46 AM
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).
Regards,
Imen
2023-03-13 05:40 AM
Hi Imen,
Can I activate the vbus if my microcontroller is in a device only mode? Thanks