title: STM32f107 usb re-enumerate
body: <p>I have a board that is connected to USB on a STM32F107 with the following pins</p>
  
  <p>USB_OTG_VBUS : PA9
  USBDM : PA11
  USBDP : PA12</p>
  
  <p>I have a project that needs to use both Virtual Com Port and USB Mass Storage. It needs to re-enumerate the USB then do a software reset to enable the different USB class.</p>
  
  <p>I have tried various different things to get it to re-enumerate but so far have been unable to, the only way to re-enumerate is to unplug usb cable.</p>
  
  <p>These are some of the functions i have tried with no success</p>
  
  <pre><code>USB_OTG_DisableGlobalInt(&amp;USB_OTG_dev);
  USB_OTG_WRITE_REG32(&amp;USB_OTG_dev.regs.GREGS-&gt;GINTSTS, 0xBFFFFFFF);
  USB_OTG_CoreReset(&amp;USB_OTG_dev);
  USBD_DeInit(&amp;USB_OTG_dev);
  DCD_DevDisconnect(&amp;USB_OTG_dev);
  NVIC_SystemReset();
  </code></pre>
  
  <p>Would anyone have any ideas on how to get the USB to re-enumerate when it is configured with only these 3 pins for the STM32F107?</p>