Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USB Device not detected: Olimex ARM-USB-OCD-H JTAG Debugger #2185

Open
gojimmypi opened this issue Jun 2, 2017 · 26 comments

Comments

@gojimmypi
Copy link

@gojimmypi gojimmypi commented Jun 2, 2017

  • Windows build number:

Microsoft Windows [Version 10.0.14393]
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

  • What I doing and what's happening:
  1. plug in USB Debugger
  2. type at bash prompt:
sudo apt-get install libtool # installed; required ?
sudo apt-get install libusb-1.0 # installed; required ?
sudo apt-get update
sudo apt-get upgrade
ls /dev/
  • What's wrong / what should be happening instead:

I expect to see /dev/ttyUSB0 (instead no new USB device found)

The device is otherwise visible in device manager (listed under "other devices", but with warning "There are no compatible drivers for this device." ), I can still connect the device to an Ubuntu VM, and it works there on the same physical machine and properly recognized / operational in the Ubuntu VM.

wsl-olimex

@sunjoong

This comment has been minimized.

Copy link

@sunjoong sunjoong commented Jun 2, 2017

@gojimmypi - Your Windows Build is 14393. From Windows Build 16176, it looks like to be able to use USB drives, CD drives, Network drives, etc.

Quote from https://blogs.msdn.microsoft.com/wsl/2017/04/18/file-system-improvements-to-the-windows-subsystem-for-linux/

In the latest Windows Insider build, the Windows Subsystem for Linux (WSL) now allows you to manually mount Windows drives using the DrvFs file system. Previously, WSL would automatically mount all fixed NTFS drives when you launch Bash, but there was no support for mounting additional storage like removable drives or network locations.

Now, not only can you manually mount any drives on your system, we’ve also added support for other file systems such as FAT, as well as mounting network locations. This enables you to access any drive, including removable USB sticks or CDs, and any network location you can reach in Windows all from within WSL.

And... WSL does not support any real physical devices outside Windows yet, so... "other devices" with warnig look like windows side problem.

UPDATE: Hmm.... I'd like to say all devices are used throuh windows and no devices are dedicated to WSL only like vbox block usb while it's set to use that. Thanks @therealkenc :).

@therealkenc

This comment has been minimized.

Copy link
Collaborator

@therealkenc therealkenc commented Jun 3, 2017

...WSL does not support any real physical devices outside Windows yet...

With the exception of /dev/ttyS*; blog post here.

@gojimmypi

This comment has been minimized.

Copy link
Author

@gojimmypi gojimmypi commented Jun 3, 2017

@sunjoong ah yes, there is mention of Version 16176 back in April:
https://blogs.windows.com/windowsexperience/2017/04/14/announcing-windows-10-insider-preview-build-16176-pc-build-15204-mobile/
I wonder when that will be available to me (Asus Desktop)? No Windows updates pending... and from @therealkenc - looks like the JTAG debugger will not work yet anyhow, as it is not a serial device / COM port?

@sunjoong

This comment has been minimized.

Copy link

@sunjoong sunjoong commented Jun 3, 2017

I wonder when that will be available to me (Asus Desktop)?

@gojimmypi - That could be available to you as preview version before public relase if you be join https://insider.windows.com/ .

@therealkenc

This comment has been minimized.

Copy link
Collaborator

@therealkenc therealkenc commented Jun 4, 2017

@gojimmypi - I am guessing your device is i2c (or something) rather than RS232? If so yeah, not supported yet.

The cool part is the original User Voice says quoth: "This ask is specifically for adding USB Device support to WSL - i.e. exposing USB busses and devices to the OS." In other words support for libusb, exactly what you want. It's closed now. Doing that is kind of their thing. I guess open another one. Possibly with the same title.

@sunjoong

This comment has been minimized.

Copy link

@sunjoong sunjoong commented Jun 4, 2017

@gojimmypi

This comment has been minimized.

Copy link
Author

@gojimmypi gojimmypi commented Jun 5, 2017

@sunjoong and @therealkenc - thanks for reply; the Olimex JTAG debugger is usually "natively" supported in Linux & despite that link, above - I have gotten it to work with Windows 10 in Visual Studio using things like VisualGDB without problems. I don't think it is a traditional "RS232" device, even though it shows up as /dev/ttyUSB0 - I thought I was an "insider" and recently received "creator" build at home (when I click on the link, I eventually end up on a page that says "welcome home"). Well, I suppose I'll just need to be patient and hopefully build 16176 will support it :)

@therealkenc

This comment has been minimized.

Copy link
Collaborator

@therealkenc therealkenc commented Jun 5, 2017

If your process on Real Linux is to install libusb (ie, your device won't work on Real Linux without installing libusb), then you'll find no joy on 16176 or the current version which is 16199. But if you'd like to be on Insiders anyway and are having difficulty (you are not alone), the big hammer fix is to visit this page and select (as of this writing) the 16193 drop-down. You should get insider updates thereafter.

@gojimmypi

This comment has been minimized.

Copy link
Author

@gojimmypi gojimmypi commented Jun 5, 2017

@therealkenc I believe libusb is required for the Olimex JTAG debugger. I have it installed:

0 $ apt-cache policy libusb-1.0
libusb-1.0-0:
  Installed: 2:1.0.17-1ubuntu2
  Candidate: 2:1.0.17-1ubuntu2
  Version table:
 *** 2:1.0.17-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
libusb-1.0-0-dbg:
  Installed: 2:1.0.17-1ubuntu2
  Candidate: 2:1.0.17-1ubuntu2
  Version table:
 *** 2:1.0.17-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
libusb-1.0-0-dev:
  Installed: 2:1.0.17-1ubuntu2
  Candidate: 2:1.0.17-1ubuntu2
  Version table:
 *** 2:1.0.17-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
libusb-1.0-doc:
  Installed: 2:1.0.17-1ubuntu2
  Candidate: 2:1.0.17-1ubuntu2
  Version table:
 *** 2:1.0.17-1ubuntu2 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status

From the User Voice link, it sounds like some folks don't agree that "Add USB Device" is complete, as the completion is for "USB serial & mounting of FAT*/NTFS formatted USB sticks". Probably right: may need to open a new issue for this type of device.

@stehufntdev

This comment has been minimized.

Copy link
Collaborator

@stehufntdev stehufntdev commented Jun 8, 2017

Agree with @therealkenc that opening a new user voice is the right thing to do here. The user voice mentioned above was crazy overloaded with anything usb (e.g. usb drives, usb serial, libusb, proprietary usb, ...) which made it hard to track. We closed it out after the usb drives and usb serial devices work with the hope more specific requests would come up like this one for libusb that can be more easily prioritized.

@barbiani

This comment has been minimized.

Copy link

@barbiani barbiani commented Feb 8, 2019

I have been successful running the win32 openocd and eclipse + build tools in wsl.

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 1, 2019

I have been successful running the win32 openocd and eclipse + build tools in wsl.

Could you share how you did that? I'm trying to do the same thing but with VS Code. Did you install OpenOCD in windows or WSL?

@barbiani

This comment has been minimized.

Copy link

@barbiani barbiani commented Jul 1, 2019

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 4, 2019

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 5, 2019

For whoever comes after me, I followed the VS Code config in this post (https://higaski.at/vscode-esp32-debugging/), but ran OpenOCD in Windows (modify the command in tasks.json) so it can connect to the USB debugger. Everything works fine now! Finally!

Here is my setup: VS Code + source code + OpenOCD in Win, toolchain+esp-gdb in WSL. The tricky part to run OpenOCD in Win because USB is not forwarded to WSL like serial ports. My debugger is ESP-Prog

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 5, 2019

I have a similar problem with the XDS110 Debug Probe from Texas Instruments or the MSP-EXP432E401Y Launchpad development board (with builtin debug probe). It connects via USB and in Windows, OpenOCD detects it automatically. However, the Linux version of OpenOCD running under WSL does not detect it.

The debug probe's COM port, which provides access to the connected device's UART I/O, passed through as a /dev/ttyS device in WSL does work when I configure it with stty and access it with cu as described in that WSL blog.

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 5, 2019

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 5, 2019

I believe my work-around will also work for you. Run OpenOCD in Windows, but use your WSL GDB connects to the OpenOCD host in Windows.

Yes, that does work, however there are some snags. The Windows OpenOCD cannot open files from the Linux filesystem, only the Windows filesystem. If I open the source folder where it exists in my Windows filesystem as a WSL remote folder, then various other Linux apps fail or misbehave (e.g. git) because the line endings are wrong. There are ways to fix/workaround the latter but it's still a pain in the ass.

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 5, 2019

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 5, 2019

That's not the problem. If I execute an openocd command from WSL bash to flash the device with a file that is in the Linux filesystem (e.g. /home/gtyler/dev/myproject/output/myproject.hex) then the Windows OpenOCD won't find that file.

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 6, 2019

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 6, 2019

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 7, 2019

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 7, 2019

@doxxx

This comment has been minimized.

Copy link

@doxxx doxxx commented Jul 10, 2019

The XDS110 can't be used to flash via a serial port, unfortunately.

However, in Windows 10 1903, Windows OpenOCD can access files in the WSL filesystem. WSL sets the current working directory to the correct \\wsl$\... path when executing a Windows app, so the Windows OpenOCD is able to resolve relative paths on its command-line.

@wildwildwilliam

This comment has been minimized.

Copy link

@wildwildwilliam wildwildwilliam commented Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.