After a reboot the problem went away.
Now I have added some more of my code. Now the application is really broken. I have added an event handler in file eventhandler.c. It is invoked through this code in usbservices.c:
USB_Services_DeviceObject.DeviceEventHandler = VDK_DeviceEventHandler;
In main_thread.c the wait loop is now using the global variable defined in eventhandler.c:
while (!usb_link) VDK_Sleep(1);
I have added to the enum in adi_net2272.h:
ADI_DEV_RESULT_NO_LINK, // 0x10017 - the usb link went down
and using it in adi_dev_Read:
while(!pBuff->ProcessedFlag) { if ( !usb_link ) return ADI_DEV_RESULT_NO_LINK; VDK_Sleep(1); }
Maybe the code I have added makes the interrupt routine execute for too long. Personally I believe that there are too much code executing in the interrupt.