utzig / lm4tools

Tools to enable multi-platform development on the TI Stellaris Launchpad boards
203 stars 47 forks source link

No ICDI device found on some of the USB ports #15

Open udif opened 11 years ago

udif commented 11 years ago

On my ThinkPad W510 running Windows 7, lm4flash doesn't work o the two SuperSpeed USB ports on the left side of the machine. It works fine on the USB port at the back, as well as on the combined eSATA/USB port on the left (next to the two SuperSpeed ports). When it doesn't work, it displays the following error message: No ICDI device with USB VID:PID 1cbe:00fd found! Failed!

The specific lm4flash.exe version is the one shipped on the latest Energia 0101E0009 (sorry, I don't know exactly what version it is). I tested this issue by running the lm4flash.exe executable on the Windows command line without Energia.

zyga commented 11 years ago

I have the same machine, it runs ubuntu though. I suspect that windows drivers don't allow those ports to work with high-speed or full-speed devices without putting a hub in between. Could you please tell me if your device works fine when plugged in via a USB 2.0 hub?

I'm not familiar with windows development much, it also could be some queer side-effect of how windows 7 USB stack works (usb3 is not native in windows 7 IIRC).

Thanks ZK

udif commented 11 years ago

I will test this tomorrow, however, I must note that TI's own LM4 flashing tool works just fine even when the board is plugged into the USB 3.0 ports. (http://www.ti.com/tool/lmflashprogrammer)

zyga commented 11 years ago

In that case it could also be libusb libusbx bug. Could you please tell me which version of which usb library are you using?

Thanks ZK

utzig commented 11 years ago

@udif Could you test the output with the lm4flash.exe build available here:

http://utzig.net/files/lm4flash.exe

This version was built with libusb debugging enabled and should output a lot of data which you could than post here. That can maybe help us debug what is happening.

udif commented 11 years ago

Here is the debug output when plugging into the USB 3.0 port: C:\energia-0101E0009\hardware\tools\lm4f\bin>\Users\udif\Desktop\lm4flash.exe xxx

libusb: 0.000000 warning [init_device] could not get node connection information for device '.\USB#VID_1CBE&PID_00FD#0E1039D7': [87] The parameter is incorrect.

Unable to find any ICDI devices

Here is the same for a USB 2.0 port: C:\energia-0101E0009\hardware\tools\lm4f\bin>\Users\udif\Desktop\lm4flash.exe xxx

Found ICDI device with serial: 0E1039D7

fopen: No such file or directory

(In case this is not clear, in both examples I used a nonexistent file xxx, but that doesn't matter as USB discovery is done before the filenames are looked up).

utzig commented 11 years ago

I'm sorry but I could not test it before but looks like that build really did not put out the required debug information. I just setup my win32 system now and rebuild lm4flash linked against both libusb and libusbx. I ask you to test both versions and send me the output. Since the output should be a little big you can send it by email if you want. And maybe one of the builds will work but send me the outputs anyway.

http://utzig.net/files/lm4flash_libusb.exe http://utzig.net/files/lm4flash_libusbx.exe

Sorry for the inconvenience!

udif commented 11 years ago

I've emailed you 4 log files, two for each tool, one where detection works (USB2) and one where detection failed (USB3).

utzig commented 11 years ago

Based on the log outputs the problem doesn't even seem to be related to libusb itself. It's probably related to the drivers for you USB3 peripheral. There's a very similar issue reported on this thread on libusb mailing list with lots of good info:

http://libusb.6.n5.nabble.com/libusb-windows-devices-only-detected-in-late-pass-ignoring-td4463538.html

I could try building a 64-bit version lm4flash. I'm not sure how to do it but I'll verify today and send you the binary for testing. Not sure if that will make any difference though.

Btw, did you try updating the drivers? Also the problems related in the thread seem to affect only Win7 x64. Are you also using x64 version?

sultanqasim commented 11 years ago

I have the same issue using Energia with my 2012 MacBook Pro (with only USB 3 ports) running Windows 7 x64.

udif commented 11 years ago

Yes, I'm running on Windows 7 x64. I'll check my drivers next time I use this machine (it's at work).