STM32L0 USB Connect-DisConnect Event
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-13 2:32 AM
Posted on June 13, 2016 at 11:32
Hi everyone,
I developed USB Hid Class on STM32L0 series.Everthing working properly but I could not get the USB Connect and Disconnect Event.I am using CubeMx and HAL_PCD_ConnectCallback and HAL_PCD_DisconnectCallback function not working . How can i get USb connect and disconnect even? Best Regards #usb-event #stm32l0
Labels:
- Labels:
-
STM32L0 Series
-
USB
This discussion is locked. Please start a new topic to ask your question.
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-13 7:46 AM
Posted on June 13, 2016 at 16:46
Hi otto.emp_otto,
I recommend that you refer to these threads that may be helpful for you: , [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32F4%20Cube%20USB%20Device%20library&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21¤tviews=501]thread2, -Hannibal-Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-14 3:04 AM
Posted on June 14, 2016 at 12:04
The VBUS sensing feature is not supported by the STM32L0. To handle connect/disconnect events you need to do this:
1/ Connect the USB VBUS signal to a GPIO pin with the corresponding EXTI interrupt enabled2/ When cable is disconnected just call these functions to stop USB operation,/* stop device */HAL_PCD_Stop(&hpcd); /* disconnect D+ pull-up */ HAL_PCD_DevDisconnect (&hpcd);3/ And on USB cable connection call: /*Initialize USB peripheral */ HAL_PCD_Init(&hpcd); /* Connect pullup */ HAL_PCD_DevConnect(&hpcd);Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-16 2:59 AM
Posted on June 16, 2016 at 11:59
Hi Abdul and Hannibal,Thank for your answers.I read STM32L0 datasheet and found like this information.
USB connect / disconnect capability (controllable embedded pull-up resistor on USB_DP line) (DocID025941 Rev 3 Page 866). Can i use this features for connect and disconnect event?Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-06-16 5:59 AM
Posted on June 16, 2016 at 14:59
NO
