USBH_Init & USBH_Exit

C Source Code

void MainTask(void)

{

USBH_Init();

USBH_Exit();

}

USBH_Exit() get stuck in a while loop in USBH_HW_STM32F2xxFS.c file in function static void _RemoveDriver(USBH_HC_HANDLE hHostController).
It seems that the variable _RemoveComplete is never set to a value different from 0.