Skip to main content
1123
Associate II
May 9, 2019
Question

How does USB reconnect with the PC without pull USB line?

  • May 9, 2019
  • 5 replies
  • 1735 views

My board is STM32L433CC

But I have a question, I can plug and reconnect to the PC in USB, but I think it is too much trouble and take time.

Is there any way to reconnect without pulling the USB cable PC?

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
May 9, 2019

Toggling the internal pullup, see USB_BCDR.DPPU

JW

1123
1123Author
Associate II
May 9, 2019

I now have USB_DP and USB_DM have a design mini usb head

But my VDDUSB also has 3.3V

If I internal pull up, will he still continue to operate?

1123
1123Author
Associate II
May 10, 2019

I found that there are newer issues, old style I re-Deinit(), in init(), I went into debug mode

Found his card USB_DevInit() this function inside,

Mainly he has to do

USBx->CNTR = USB_CNTR_FRES;

USBx->CNTR = 0;

When doing CNTR = 0, the error occurs directly to determine my internal command error

So I don't understand much, just do initialization, how to directly error

WBieg
Associate
May 21, 2020

i'm using micro instruction and time delay before MX_USB_DEVICE_Init();

RESTART_USB;
HAL_Delay(500);
MX_USB_DEVICE_Init();
#define RESTART_USB 	do{GPIO_InitTypeDef GPIO_InitStruct = {GPIO_PIN_12, GPIO_MODE_OUTPUT_PP};\
	HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);\
	HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);}while(0)

Tesla DeLorean
Guru
May 21, 2020
Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..