This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB disconnect problem on stm32f205

hello

i am working on a project with stm32f205 and keil uvision5.

i am using the cmsis rtos.

when i plug the usb to my board the usb tasks are created quickly.

the problem is when i unplug the usb , for removing the usb task i use this functions :
Usb_Status = USBD_Disconnect(0);
Usb_Status = USBD_Uninitialize(0);

but it takes too much time to remove the usb tasks (about 6 to 8 seconds).

i have verified and it seems that the program is bloking in this part :

while ((OTG->GINTSTS & OTG_FS_GINTSTS_GONAKEFF) == 0U);

this code is part of the file : USBD_FS_STM32F2xx.c (static int32_t USBD_EndpointUnconfigure (uint8_t ep_addr)).

thanks.