cancel
Showing results for 
Search instead for 
Did you mean: 

USB device disconnect and connect in STM32L0

Posted on December 29, 2014 at 17:02

Hi 

I just begin in STM32L0. I using my board for dev an USB example base STM32L053R8. 

And I have a confused about USB connect and disconnect.  I run a test case based on STM32L053R8_NUCLEO_USB for test. And I don't want USB host detect USB device till I call function USBD_Start at the code below. But the Host still detect my USB device. I have check the bit DPPU (BCDR register). It is still disable. I can not Image what is the reason 

  /* Init Device Library */

  USBD_Init(&USBD_Device, &HID_Desc, 0);

  

  /* Register the HID class */

  USBD_RegisterClass(&USBD_Device, &USBD_HID);

  

while (1); 

  /* Start Device Process */

  USBD_Start(&USBD_Device);

Thank for help. 

Kevin 

#stm32l0-usb-disconnect-connect
1 REPLY 1
tsuneo
Senior
Posted on December 30, 2014 at 15:52

Likely, you are working on STM32Cube_FW_L0_V1.1.0?

And then, the stack code doesn't enable on-chip pull-up resistor until USBD_Start() is called.

Does your ''dev board'' have an external fixed pull-up?

Tsuneo