Skip to content

dfu-util does not list devices when Windows-version does #3069

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

Closed
billbogaiv opened this issue Mar 31, 2018 · 5 comments
Closed

dfu-util does not list devices when Windows-version does #3069

billbogaiv opened this issue Mar 31, 2018 · 5 comments

Comments

@billbogaiv
Copy link

Windows build number: Microsoft Windows [Version 10.0.16299.334]

I am using WSL in combination with a Particle Photon and part of that process involves using dfu-util. This command is used to manage firmware via USB. There are native builds for Windows and Linux. I am using v0.8. When I run the command dfu-util.exe -l on Windows, I see my expected device:

Found DFU: [2b04:d006] ver=0250, devnum=32, cfg=1, intf=0, alt=1, name="@DCT Flash   /0x00000000/01*016Kg", serial="<intentionally omitted>"

When I run dfu-util -l via WSL, I get nothing (no output and no errors). Running this setup in native-Linux works the same as Windows.

Note: I can communicate via serial using /dev/ttyS..., so WSL is at-least "aware" of the device.

@therealkenc
Copy link

No strace log because you deleted the template (natch) but on WSL /sys/bus is an empty directory. #1521, #2195, #2287, #2185 et al.

@billbogaiv
Copy link
Author

billbogaiv commented Mar 31, 2018

Here's the log for anyone who wants to take a look:

execve("/usr/bin/dfu-util", ["dfu-util", "-l"], [/* 22 vars */]) = 0
brk(NULL)                               = 0x1ea9000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=25525, ...}) = 0
mmap(NULL, 25525, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f98e5171000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libusb-1.0.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0=\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=97056, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f98e5170000
mmap(NULL, 2192480, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f98e4be0000
mprotect(0x7f98e4bf7000, 2093056, PROT_NONE) = 0
mmap(0x7f98e4df6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f98e4df6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\t\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1868984, ...}) = 0
mmap(NULL, 3971488, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f98e4810000
mprotect(0x7f98e49d0000, 2097152, PROT_NONE) = 0
mmap(0x7f98e4bd0000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c0000) = 0x7f98e4bd0000
mmap(0x7f98e4bd6000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f98e4bd6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libudev.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\0\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=126840, ...}) = 0
mmap(NULL, 130656, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f98e5150000
mmap(0x7f98e516e000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x7f98e516e000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260`\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=138696, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f98e5140000
mmap(NULL, 2212904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f98e45f0000
mprotect(0x7f98e4608000, 2093056, PROT_NONE) = 0
mmap(0x7f98e4807000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f98e4807000
mmap(0x7f98e4809000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f98e4809000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0!\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=31712, ...}) = 0
mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f98e43e0000
mprotect(0x7f98e43e7000, 2093056, PROT_NONE) = 0
mmap(0x7f98e45e6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f98e45e6000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f98e5130000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f98e5120000
arch_prctl(ARCH_SET_FS, 0x7f98e5120740) = 0
mprotect(0x7f98e4bd0000, 16384, PROT_READ) = 0
mprotect(0x7f98e4807000, 4096, PROT_READ) = 0
mprotect(0x7f98e45e6000, 4096, PROT_READ) = 0
mprotect(0x7f98e516e000, 4096, PROT_READ) = 0
mprotect(0x7f98e4df6000, 4096, PROT_READ) = 0
mprotect(0x609000, 4096, PROT_READ)     = 0
mprotect(0x7f98e5025000, 4096, PROT_READ) = 0
munmap(0x7f98e5171000, 25525)           = 0
set_tid_address(0x7f98e5120a10)         = 1978
set_robust_list(0x7f98e5120a20, 24)     = 0
rt_sigaction(SIGRTMIN, {0x7f98e45f5b50, [], SA_RESTORER|SA_SIGINFO, 0x7f98e4601390}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f98e45f5be0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f98e4601390}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=8192*1024}) = 0
write(1, "dfu-util 0.8\n", 13)          = 13
write(1, "\n", 1)                       = 1
write(1, "Copyright 2005-2009 Weston Schmi"..., 231) = 231
write(1, "\n", 1)                       = 1
gettimeofday({1522508394, 765302}, NULL) = 0
brk(NULL)                               = 0x1ea9000
brk(0x1eca000)                          = 0x1eca000
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/proc/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/dev", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=512, ...}) = 0
getdents(3, /* 212 entries */, 32768)   = 6680
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
clock_gettime(CLOCK_MONOTONIC, {5319, 558233000}) = 0
uname({sysname="Linux", nodename="billbogaiv", ...}) = 0
uname({sysname="Linux", nodename="billbogaiv", ...}) = 0
uname({sysname="Linux", nodename="billbogaiv", ...}) = 0
uname({sysname="Linux", nodename="billbogaiv", ...}) = 0
stat("/sys/bus/usb/devices", 0x7fffea879bf0) = -1 ENOENT (No such file or directory)
open("/etc/udev/udev.conf", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=153, ...}) = 0
read(3, "# see udev.conf(5) for details\n#"..., 512) = 153
read(3, "", 512)                        = 0
close(3)                                = 0
access("/run/udev/control", F_OK)       = -1 ENOENT (No such file or directory)
socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC|SOCK_NONBLOCK, NETLINK_KOBJECT_UEVENT) = 3
setsockopt(3, SOL_SOCKET, SO_ATTACH_FILTER, "\10\0\0\0\0\0\0\0P\213\207\352\377\177\0\0", 16) = -1 EINVAL (Invalid argument)
bind(3, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
getsockname(3, {sa_family=AF_NETLINK, pid=1978, groups=00000000}, [12]) = 0
setsockopt(3, SOL_SOCKET, SO_PASSCRED, [1], 4) = -1 EINVAL (Invalid argument)
fcntl(3, F_GETFL)                       = 0x80802 (flags O_RDWR|O_NONBLOCK|O_CLOEXEC)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK|O_CLOEXEC) = 0
pipe([4, 5])                            = 0
fcntl(5, F_GETFL)                       = 0x1 (flags O_WRONLY)
fcntl(5, F_SETFL, O_WRONLY|O_NONBLOCK)  = 0
mmap(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x7f98e3bd0000
mprotect(0x7f98e3bd0000, 4096, PROT_NONE) = 0
clone(child_stack=0x7f98e43cffb0, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x7f98e43d09d0, tls=0x7f98e43d0700, child_tidptr=0x7f98e43d09d0) = 1979
gettid()                                = 1978
getrandom("-m\365?}\316jz\374-|3~c\271\264", 16, GRND_NONBLOCK) = 16
access("/sys/subsystem", F_OK)          = -1 ENOENT (No such file or directory)
open("/sys/bus", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
fstat(6, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents(6, /* 2 entries */, 32768)     = 48
getdents(6, /* 0 entries */, 32768)     = 0
close(6)                                = 0
open("/sys/class", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
fstat(6, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents(6, /* 7 entries */, 32768)     = 200
getdents(6, /* 0 entries */, 32768)     = 0
close(6)                                = 0
pipe([6, 7])                            = 0
fcntl(7, F_GETFL)                       = 0x1 (flags O_WRONLY)
fcntl(7, F_SETFL, O_WRONLY|O_NONBLOCK)  = 0
write(7, "\1", 1)                       = 1
timerfd_create(CLOCK_MONOTONIC, TFD_NONBLOCK) = 8
recvmsg(3, 0x7fffea877b10, 0)           = -1 EAGAIN (Resource temporarily unavailable)
exit_group(0)                           = ?
+++ exited with 0 +++

@therealkenc
Copy link

therealkenc commented Mar 31, 2018

open("/sys/bus", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 6
fstat(6, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
getdents(6, /* 2 entries */, 32768)     = 48
getdents(6, /* 0 entries */, 32768)     = 0

getdents returned nothing. It would be easier to do ls /sys/bus.

@DanielGGordon
Copy link

The response here is a little cryptic - what is the solution for this? I also have firmware that needs to be flashed with dfu-util and it is not being picked up in WSL

@MichaelShmalkoProCoder
Copy link

Any updates on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants