cancel
Showing results for 
Search instead for 
Did you mean: 

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

1123
Associate II

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?

5 REPLIES 5

Toggling the internal pullup, see USB_BCDR.DPPU

JW

1123
Associate II

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
Associate II

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 II

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)

Dupe https://community.st.com/s/question/0D50X0000AX4UptSQF/how-does-usb-reconnect-with-the-pc-without-being-pulled-out

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..