I have been having major grief with my uLink2 of late, rendering it virtually unusable!
:-(
I've had it about 4 months with just the usual occasional annoyances of lost comms - then it just went totally stupid!
I'm working with an STM32 target, downloading an AXF file.
After clicking the 'Load' button, I get the 'USB communication failure', or uVision will hang.
Other projects, and earlier versions of the same project, would work fine - it seemed to be something specific to the particular AXF file!
The same AXF file would work fine on another PC of mine, and my Client was able to use it OK - so then it looked like something funny with the particular Toshiba P300 Laptop. But then, on a visit to the Client, it was fine on that Toshiba!
I have now just stumbled on something: it seems that the uLink2 behaves fine on the Toshiba provided I remove all other USB HIDs (mouse, keyboard)
So, has anyone else had similar troubles with a uLink2?
Or, if you are having trouble with your uLink2, have you tried disconnecting all other USB HIDs?
Do any of the USB experts here have any ideas what might be going on?
Sorry for the rambling, but it's been one of those issues...
The uLink troubles teach us good lesson of robust USB implementation.
a) On the host app, call USB Read / Write (such as ReadFile/WriteFile) asynchronously (OVERLAPPED). Even when the device hangs on the interrupt/bulk endpoint, your host app detects timeout, and cancels the call. To recover from hang, send a class request (for HID, Feature report), reset the hanged process on the device side.
b) On the host app, detect surprise removal of the device using WM_DEVICECHANGE (RegisterDeviceNotification()). On surprised removal, close the USB device handle and kill the USB communication thread. Then, plugging off the USB cable recovers the hang without rebooting the PC. On the device side, bus-powered device like uLink2 gets reset by power-cycle.
For the host app for HID, see Jan's implementation of WM_DEVICECHANGE.
generic_hid_cs on The HID Page (http://www.lvr.com/hidpage.htm) www.lvr.com/.../generic_hid_cs_451.zip DeviceManagementDeclarations.cs DeviceManagement.cs
Tsuneo
As of the original post, "I have now just stumbled on something: it seems that the uLink2 behaves fine on the Toshiba provided I remove all other USB HIDs (mouse, keyboard)"
Sound like PC hardware and/or noise problem around the USB connector, or the internal hub of the laptop.
Can you suggest any tips, tools, etc to pin this down? (I'm purely a user as far as USB goes - not a developer!)
It does seem to be the USB mouse that causes (or provokes?) the problem(s).
Both the mouse & keyboard are via a hub (the same hub); it doesn't make any difference whether the uLink2 is also in that hub, or direct to the laptop.
Umm... I remember that BIOS and firmware update sometimes fix unstable hardware. Search the update for your Toshiba P300 Laptop.
BIOS Downloads " href= "http://uk.computers.toshiba-europe.com/innovation/download_drivers_bios.jsp?service=UK"> uk.computers.toshiba-europe.com/.../download_drivers_bios.jsp
Also, Windows Service Pack, too
Just had another episode of USB stupidity on this PC.
This time nothing to do with Keil or uLink - but COM ports (specifically, on a BAFO USB-to-RS232 adaptor).
I noticed that Device Manager was showing a "Microsoft Ballpoint Mouse" (or even mice) being spuriously detected on those COM ports.
I found this article: www.pcmaritime.co.uk/.../jumpingmouse.html It recommends adding /NoSerialMouse as a Windows startup option
I've made the change - now we'll see if things improve...
I have no idea whether this may or may not be related to my earlier uLink problems...
PS
Microsoft say that /fastdetect should disable serial mouse detection: support.microsoft.com/.../833721 - but I already had that option set, so its obviously not entirely true!
Some more info here: support.microsoft.com/.../283063