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

windows support #1

Open
HarelAshwal opened this issue Aug 21, 2017 · 20 comments
Open

windows support #1

HarelAshwal opened this issue Aug 21, 2017 · 20 comments
Assignees

Comments

@HarelAshwal
Copy link

LK"I

Hi ,

Is there any support for windows?
when i try to :
npm run electron-rebuild

I get these errors:

[email protected] electron-rebuild C:\projects_node\test_burner\BeagleBoot
electron-rebuild

x Rebuild Failed

An unhandled error occurred inside electron-rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
core.c
descriptor.c
hotplug.c
io.c
strerror.c
sync.c
poll_windows.c
threads_windows.c
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
rojects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\io.c(1227): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
..\libusb\libusb\io.c(1902): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
..\libusb\libusb\io.c(2435): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
[C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
windows_usb.c
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
[C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
windows.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\os\threads_windows.c(194): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner
]
..\libusb\libusb\os\threads_windows.c(196): warning C4244: '=': conversion from 'const time_t' to 'long', possible loss of data [C:\projects_node\test_
cxproj]
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
dows.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
usb.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\os\windows_usb.c(586): warning C4244: '=': conversion from '__int64' to 'unsigned int', possible loss of data [C:\projects_node\test_b
xproj]
..\libusb\libusb\os\windows_usb.c(1017): warning C4996: 'GetVersionExA': was declared deprecated [C:\projects_node\test_burner\BeagleBoot\node_modules
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1020): warning C4996: 'GetVersionExA': was declared deprecated [C:\projects_node\test_burner\BeagleBoot\node_modules
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1423): warning C4244: '=': conversion from '_int64' to 'unsigned int', possible loss of data [C:\projects_node\test
cxproj]
..\libusb\libusb\os\windows_usb.c(2558): warning C4018: '<': signed/unsigned mismatch [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\l
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\projects_node\test_burner\BeagleBoot\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\projects_node\test_burner\BeagleBoot\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
//atom.io/download/electron" "--build-from-source" "--module_name=usb_bindings" "--module_path=C:\projects_node\test_burner\BeagleBoot\node_modules
essel/node-usb/releases/download/" "--remote_path=1.2.0"
gyp ERR! cwd C:\projects_node\test_burner\BeagleBoot\node_modules\usb
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Failed with exit code: 1

Error: Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
core.c
descriptor.c
hotplug.c
io.c
strerror.c
sync.c
poll_windows.c
threads_windows.c
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
rojects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\io.c(1227): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
..\libusb\libusb\io.c(1902): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
..\libusb\libusb\io.c(2435): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner\BeagleBoot\nod
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
[C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
windows_usb.c
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
[C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
windows.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\os\threads_windows.c(194): warning C4244: '=': conversion from 'time_t' to 'long', possible loss of data [C:\projects_node\test_burner
]
..\libusb\libusb\os\threads_windows.c(196): warning C4244: '=': conversion from 'const time_t' to 'long', possible loss of data [C:\projects_node\test_
cxproj]
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
dows.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
C:\projects_node\test_burner\BeagleBoot\node_modules\usb\libusb\libusb\os/threads_windows.h(47): error C2011: 'timespec': 'struct' type redefinition (c
usb.c) [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\libusb.vcxproj]
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h(39): note: see declaration of 'timespec' (compiling source file ..\libusb\lib
..\libusb\libusb\os\windows_usb.c(586): warning C4244: '=': conversion from '__int64' to 'unsigned int', possible loss of data [C:\projects_node\test_b
xproj]
..\libusb\libusb\os\windows_usb.c(1017): warning C4996: 'GetVersionExA': was declared deprecated [C:\projects_node\test_burner\BeagleBoot\node_modules
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1020): warning C4996: 'GetVersionExA': was declared deprecated [C:\projects_node\test_burner\BeagleBoot\node_modules
C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
..\libusb\libusb\os\windows_usb.c(1423): warning C4244: '=': conversion from '_int64' to 'unsigned int', possible loss of data [C:\projects_node\test
cxproj]
..\libusb\libusb\os\windows_usb.c(2558): warning C4018: '<': signed/unsigned mismatch [C:\projects_node\test_burner\BeagleBoot\node_modules\usb\build\l
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\projects_node\test_burner\BeagleBoot\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\projects_node\test_burner\BeagleBoot\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
//atom.io/download/electron" "--build-from-source" "--module_name=usb_bindings" "--module_path=C:\projects_node\test_burner\BeagleBoot\node_modules
essel/node-usb/releases/download/" "--remote_path=1.2.0"
gyp ERR! cwd C:\projects_node\test_burner\BeagleBoot\node_modules\usb
gyp ERR! node -v v6.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Failed with exit code: 1
at SafeSubscriber._error (C:\projects_node\test_burner\BeagleBoot\node_modules\spawn-rx\lib\src\index.js:267:84)
at SafeSubscriber.__tryOrUnsub (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:238:16)
at SafeSubscriber.error (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:197:26)
at Subscriber._error (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:128:26)
at Subscriber.error (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:102:18)
at MapSubscriber.Subscriber._error (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:128:26)
at MapSubscriber.Subscriber.error (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:102:18)
at SafeSubscriber._next (C:\projects_node\test_burner\BeagleBoot\node_modules\spawn-rx\lib\src\index.js:241:65)
at SafeSubscriber.__tryOrUnsub (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:238:16)
at SafeSubscriber.next (C:\projects_node\test_burner\BeagleBoot\node_modules\rxjs\Subscriber.js:185:22)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "electron-rebuild"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] electron-rebuild: electron-rebuild
npm ERR! Exit status 4294967295
npm ERR!
npm ERR! Failed at the [email protected] electron-rebuild script 'electron-rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the beagleboot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! electron-rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs beagleboot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls beagleboot
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\projects_node\test_burner\BeagleBoot\npm-debug.log

@ravikp7
Copy link
Owner

ravikp7 commented Aug 21, 2017

  • Windows is currently not supported. Only Linux and OSX are supported currently.
  • Though you can get this rebuild working. This app depends on node-beagle-boot module to boot BeagleBone into USB Mass Storage. And this module relies on node-usb module whose current 1.2.0 release doesn't support VS 2015, 17 for build. See v1.3.0 not published in NPM node-usb/node-usb#193
  • So, currently we've to use VS 2013 for build on Windows. This solves the rebuild issue for now and app runs.
  • But as I said Windows isn't supported yet. For Windows support, I'd need to update node-beagle-boot as we're having bootloader transfer issues on Windows. I'll update the documentation regarding this.
  • In meantime you can try this on Linux and OSX. Thanks for trying the app :)

@ravikp7 ravikp7 self-assigned this Aug 21, 2017
@HarelAshwal
Copy link
Author

LK"I

OK thanks for the quick replay. looking forward to work with it with windows!
What about linux VM hosted on windows station, is it possible to run it with Linux VM ? something like Linux on VirtualBox?

Harel

@ravikp7
Copy link
Owner

ravikp7 commented Aug 21, 2017

I'm not sure, but you can can try it on a virtual machine. I recommend you to try using VMware. They have a good USB support plus there are many tutorials online regarding usb on vmware. Also get the lts 6.11.2 version of node installed first to run this. Or if you can wait, this week I'll be publishing the native packages to run the app directly on Linux and OS X.

@jadonk
Copy link

jadonk commented Aug 23, 2017

We've talked about 2 ways to handle the Windows support issue:

  1. Update u-boot/SPL to use the default configuration such that Windows can use them.
  2. Manually add control transfers to select the desired configuration.

@ravikp7 ravikp7 added this to the Windows Support milestone Aug 24, 2017
@ravikp7
Copy link
Owner

ravikp7 commented Aug 28, 2017

This issue needs to be fixed ravikp7/node-beagle-boot#14 for Windows Support

@yassinjaffer
Copy link

I've changed the default configuration in ether.c but still unable to open RNDIS in windows.
RNDIS ready
high speed config #1: 2 mA, Ethernet Gadget, using RNDIS

[32.423678] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.501439] [00001258] libusb: debug [message_callback_handle_device_change] PRO: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 (CONNECTED)
[32.505951] [00001258] libusb: debug [windows_enumerate_device] PRO: USB\VID_0525&PID_A4A2\6&4B80D74&0&3
[32.505951] [00001258] libusb: debug [windows_enumerate_device] allocating new device for session [16A]
[32.505951] [00001258] libusb: debug [get_api_type] driver(s): USB_RNDIS
[32.505951] [00001258] libusb: debug [init_device]
[32.505951] [00001258] libusb: debug [init_device] found 2 configuration(s) (active conf: 1)
[32.505951] [00001258] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 67 bytes)
[32.506452] [00001258] libusb: debug [cache_config_descriptors] cached config descriptor 1 (bConfigurationValue=2, 9 bytes)
[32.506452] [00001258] libusb: debug [init_device] (bus: 1, addr: 20, depth: 2, port: 3): 'USB\VID_0525&PID_A4A2\6&4B80D74&0&3'
[32.506452] [00002864] libusb: debug [handle_events] poll() returned 1
[32.506452] [00002864] libusb: debug [handle_events] caught a fish on the hotplug pipe
[32.506452] [00002864] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms
[32.506452] [00002864] libusb: debug [handle_events] poll() returned 0
[32.506452] [00002864] libusb: debug [libusb_get_next_timeout] no URBs, no timeout!
[32.506452] [00002864] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[32.506452] [00002864] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[32.506452] [00001258] libusb: debug [message_callback_handle_device_change] IFC: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 {AD498944-762F-11D0-8DCB-00C04FC3358C} (CONNECTED)
[32.509460] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_list]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_descriptor]
[32.509961] [00003228] libusb: debug [libusb_get_device_list]
[32.509961] [00003228] libusb: debug [libusb_get_device_list]
[32.511469
bundle.js:20287 {"description":"uboot =>","complete":11.11}

bundle.js:20287 c:\dev\BeagleBoot\node_modules\usb\usb.js:33
this.__open()
^

Error: LIBUSB_ERROR_NOT_SUPPORTED
at Device.usb.Device.open (c:\dev\BeagleBoot\node_modules\usb\usb.js:33:7)
at transfer (c:\dev\BeagleBoot\node_modules\beagle-boot\main.js:118:12)
at Timeout.setTimeout [as _onTimeout] (c:\dev\BeagleBoot\node_modules\beagle-boot\main.js:87:33)
at ontimeout (timers.js:365:14)
at tryOnTimeout (timers.js:237:5)
at Timer.listOnTimeout (timers.js:207:5)

bundle.js:20287 ] [00001258] libusb: debug [message_callback_handle_device_change] parent device 'USB\VID_1A40&PID_0101\5&2EDA7E1E&0&3'
[32.511469] [00001258] libusb: debug [message_callback_handle_device_change] IFC: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 {CAC88484-7515-4C03-82E6-71A87ABAC361} (CONNECTED)
[32.516980] [00001258] libusb: debug [message_callback_handle_device_change] parent device 'USB\VID_1A40&PID_0101\5&2EDA7E1E&0&3'
[33.010810] [00003228] libusb: debug [libusb_open] open 1.20
[33.010810] [00003228] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[33.010810] [00003228] libusb: debug [libusb_open] open 1.20 returns -12
[33.010810] [00003228] libusb: debug [libusb_open] open 1.20
[33.010810] [00003228] libusb: debug [unsupported_open] unsupported API call for 'open' (unrecognized device driver)
[33.010810] [00003228] libusb: debug [libusb_open] open 1.20 returns -12

@ravikp7
Copy link
Owner

ravikp7 commented Oct 2, 2017

Hi @yassinjaffer , can you please share your changes in ether.c , so that I can test it.
Thanks

@ravikp7
Copy link
Owner

ravikp7 commented Oct 2, 2017

Hi @yassinjaffer , you also need to install the WinUSB drivers for the SPL device also through Zadig. You've probably already installed it for the ROM device. After SPL transfer, the device shows up as SPL device. uboot needs to be transferred to this SPL device and your logs show that it's failing at uboot transfer due to libusb not supported error.

@yassinjaffer
Copy link

Hi
I don't think there is a need to change the configuration is the ether.c the driver lists the RNDIS config first
https://github.com/u-boot/u-boot/blob/master/drivers/usb/gadget/ether.c#L903

@yassinjaffer
Copy link

[ 7.810958] [00002758] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[ 8.106751] [00000b50] libusb: debug [message_callback_handle_device_change] PRO: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 (CONNECTED)
[ 8.117272] [00000b50] libusb: debug [windows_enumerate_device] PRO: USB\VID_0525&PID_A4A2\6&4B80D74&0&3
[ 8.117272] [00000b50] libusb: debug [windows_enumerate_device] allocating new device for session [16A]
[ 8.117272] [00000b50] libusb: debug [get_api_type] driver(s): WinUSB
[ 8.117272] [00000b50] libusb: debug [get_api_type] matched driver name against WinUSB
[ 8.117272] [00000b50] libusb: debug [init_device]
[ 8.117272] [00000b50] libusb: debug [init_device] found 2 configuration(s) (active conf: 1)
[ 8.117272] [00000b50] libusb: debug [cache_config_descriptors] cached config descriptor 0 (bConfigurationValue=1, 67 bytes)
[ 8.117272] [00000b50] libusb: debug [cache_config_descriptors] cached config descriptor 1 (bConfigurationValue=2, 9 bytes)
[ 8.117272] [00000b50] libusb: debug [init_device] (bus: 1, addr: 16, depth: 2, port: 3): 'USB\VID_0525&PID_A4A2\6&4B80D74&0&3'
[ 8.117272] [00002758] libusb: debug [handle_events] poll() returned 1
[ 8.117272] [00002758] libusb: debug [handle_events] caught a fish on the hotplug pipe
[ 8.117773] [00002758] libusb: debug [handle_events] poll() 2 fds with timeout in 0ms
[ 8.117773] [00002758] libusb: debug [handle_events] poll() returned 0
[ 8.117773] [00002758] libusb: debug [libusb_get_next
bundle.js:20287 {"description":"uboot =>","complete":55.56}

bundle.js:20287 _timeout] no URBs, no timeout!
[ 8.117773] [00002758] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 8.117773] [00002758] libusb: debug [handle_events] poll() 2 fds with timeout in 60000ms
[ 8.117773] [00000b50] libusb: debug [message_callback_handle_device_change] IFC: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 {16AFA3A6-BB0E-46DF-8453-7CBC92AE9CCA} (CONNECTED)
[ 8.117773] [0000079c] libusb: debug [libusb_get_device_descriptor]
[ 8.117773] [0000079c] libusb: debug [libusb_get_device_list]
[ 8.117773] [0000079c] libusb: debug [libusb_get_device_list]
[ 8.117773] [0000079c] libusb: debug [libusb_get_device_list]
[ 8.117773] [0000079c] libusb: debug [libusb_get_device_list]
[ 8.124290] [00000b50] libusb: debug [message_callback_handle_device_change] parent device 'USB\VID_1A40&PID_0101\5&2EDA7E1E&0&3'
[ 8.124290] [00000b50] libusb: debug [message_callback_handle_device_change] IFC: USB\VID_0525&PID_A4A2\6&4B80D74&0&3 {DEE824EF-729B-4A0E-9C14-B7117D33A817} (CONNECTED)
[ 8.130808] [00000b50] libusb: debug [message_callback_handle_device_change] parent device 'USB\VID_1A40&PID_0101\5&2EDA7E1E&0&3'
[ 8.644675] [0000079c] libusb: debug [libusb_open] open 1.16
[ 8.645178] [0000006c] libusb: debug [libusb_set_configuration] configuration 1
[ 8.645178] [0000006c] libusb: debug [libusb_claim_interface] interface 0
[ 8.645678] [0000006c] libusb: debug [winusbx_claim_interface] claimed interface 0
[ 8.645678] [0000006c] libusb: debug [libusb_get_config_descriptor] index 0
[ 8.645678] [0000006c] libusb: debug [windows_assign_endpoints] (re)assigned endpoint 82 to interface 0
[ 8.645678] [0000006c] libusb: debug [auto_claim] auto-claimed interface 0 for control request
[ 8.645678] [0000006c] libusb: debug [winusbx_submit_control_transfer] will use interface 0
[ 8.645678] [0000006c] libusb: debug [usbi_add_pollfd] add fd 2 events 1
[ 8.645678] [00002758] libusb: debug [handle_events] poll() returned 1
[ 8.645678] [00002758] libusb: debug [handle_events] caught a fish on the control pipe
[ 8.645678] [0000006c] libusb: debug [libusb_get_next_timeout] next timeout in 0.999295s
[ 8.645678] [0000006c] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 8.645678] [0000006c] libusb: debug [handle_events] poll fds modified, reallocating
[ 8.645678] [0000006c] libusb: debug [handle_events] poll() 3 fds with timeout in 1000ms
[ 8.645678] [0000006c] libusb: debug [handle_events] poll() returned 1
[ 8.645678] [0000006c] libusb: debug [windows_handle_events] checking fd 2 with revents = 0001
[ 8.645678] [0000006c] libusb: debug [usbi_remove_pollfd] remove fd 2
[ 8.646179] [0000006c] libusb: debug [windows_transfer_callback] handling I/O completion with errcode 0, size 0
[ 8.646179] [0000006c] libusb: debug [libusb_release_interface] interface 0
[ 8.646179] [0000006c] libusb: debug [auto_release] auto-released interface 0
[ 8.646179] [0000006c] libusb: debug [usbi_handle_transfer_completion] transfer 000002453AFD9D48 has callback 00007FFF1D3BD250
[ 8.646179] [0000006c] libusb: debug [sync_transfer_cb] actual_length=0
[ 8.646179] [00002758] libusb: debug [libusb_get_next_timeout] next timeout in 0.999295s
[ 8.646179] [00002758] libusb: debug [libusb_handle_events_timeout_completed] doing our own event handling
[ 8.646179] [00002758] libusb: debug [handle_events] poll fds modified, reallocating
[ 8.646179] [00002758] libusb: debug [handle_events] poll() 2 fds with timeout in 1000ms
[ 8.646179] [0000079c] libusb: debug [libusb_claim_interface] interface 0
[ 8.647181] [0000079c] libusb: debug [winusbx_claim_interface] claimed interface 0
[ 8.647181] [0000079c] libusb: debug [libusb_get_config_descriptor] index 0
[ 8.647181] [0000079c] libusb: debug [windows_assign_endpoints] (re)assigned endpoint 82 to interface 0
[ 8.647181] [0000079c] libusb: debug [libusb_claim_interface] interface 1
[ 8.647181] [0000079c] libusb: debug [winusbx_claim_interface] claimed interface 1
[ 8.647181] [0000079c] libusb: debug [libusb_get_config_descriptor] index 0
[ 8.647181] [0000079c] libusb: debug [wind
bundle.js:20287 {"description":"Interface claimed","complete":61.11}

bundle.js:20287 {"umsError":"ERROR in inTransfer"}

@yassinjaffer
Copy link

high speed config #1: 2 mA, Ethernet Gadget, using RNDIS
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2396/usb_eth_init()
Problem booting with BOOTP

ERROR ### Please RESET the board

@ravikp7
Copy link
Owner

ravikp7 commented Oct 3, 2017

On Windows and macOS, I'm not getting the default config as rndis. I set the rndis config on macOS through libusb, then it worked. On Windows, changing config isn't supported through libusb. So, the config needs to be changed in uboot for this.
How did you get the interface claimed for the spl device for uboot transfer above ? Did you use different binaries other than the ones provided ?

@yassinjaffer
Copy link

I've built commit id 524123a70761110c5cf3ccc5f52f6d4da071b959
and changed RNDIS config to 1 CDC config to 2 as well as changing the configuarion in the main.js to 1

@yassinjaffer
Copy link

Ive also tried the latest mainline u-boot

@yassinjaffer
Copy link

Hi Ravi
I've added special routine to handle windows case through cdc-ether configuration

function ether_transfer(filePath, device, foundDevice){
var ifaces = os.networkInterfaces();
setTimeout(function () {
for(var interfaceName in os.networkInterfaces()) {
if(typeof(ifaces[interfaceName]) == 'undefined'){
defIface = interfaceName;
var cmd = 'netsh interface ip set address name="'+interfaceName+ '" static 192.168.0.1 255.255.255.0';
childProcess.exec(cmd, (error, stdout, stderr) => {
if (error) {
emitterMod.emit('error', "Network Control " +error);
return;
}
description = path.basename(filePath)+" =>";
emitterMod.emit('progress', {description: description, complete: +percent.toFixed(2)});
dhcp_create();
tftp_create();
});
break;
}
}
}, 1500);
}

function tftp_create() {
tftp_server = tftp_mod.createServer({
host: "0.0.0.0",
port: 69,
root: path.join(__dirname, 'bin')
});

tftp_server.on ("error", function (error){
	emitterMod.emit('error', "TFTP Transfer " +error);
});

tftp_server.on ("request", function (req, res){
	req.on ("error", function (error){
		emitterMod.emit('error', "TFTP Transfer " + error.message);
	});
	req.on ("end", function (){
		percent += increment;
		emitterMod.emit('progress', {description: "uboot transfer complete", complete: +percent.toFixed(2)});
	});		
	emitterMod.emit('progress', {description: "uboot transfer starts", complete: +percent.toFixed(2)});
});	
tftp_server.listen ();

}

function dhcp_create() {
dhcp_socket = dgram.createSocket('udp4');

dhcp_socket.bind({host: INADDR_ANY, port:DHCP_SERVER_PORT}, () => {
dhcp_socket.setTTL(1);
dhcp_socket.setBroadcast(true);
});

dhcp_socket.on('error', (error) => {
emitterMod.emit('error', "Network Control " +error);
dhcp_socket.close();
});

dhcp_socket.on('listening', () => {
const address = dhcp_socket.address();
console.log(dhcp_socket listening ${address.address}:${address.port});
});

dhcp_socket.on('message', (msg, rinfo) => {
var bootp = protocols.eth_parse_bootp(msg);
ether = protocols.decode_ether(toBuffer(bootp.hwaddr));
bootreply = protocols.make_bootp(servername, 'uboot', bootp.xid, ether.h_dest, BB_ip, server_ip);
dhcp_socket.send(bootreply, DHCP_CLIENT_PORT, INADDR_BROADCAST, (error) => {
if (error) {
emitterMod.emit('error', "Network Control " +error);
dhcp_socket.close();
}
});
});
}

@yassinjaffer
Copy link

And this is the udp packet pareser
var eth_bootp = new Parser()
.uint8('opcode')
.uint8('hw')
.uint8('hwlength')
.uint8('hopcount')
.uint32be('xid')
.uint16be('secs')
.uint16be('flags')
.array('ciaddr',{
type: 'uint8',
length: 4
})
.array('yiaddr',{
type: 'uint8',
length: 4
})
.array('server_ip',{
type: 'uint8',
length: 4
})
.array('bootp_gw_ip',{
type: 'uint8',
length: 4
})
.array('hwaddr',{
type: 'uint8',
length: 16
})
.array('servername',{
type: 'uint8',
length: 64
})
.array('bootfile',{
type: 'uint8',
length: 128
})
.uint32be('magicCookie')
.array('options', {
type: Parser.start()
.uint8('option')
.uint8('optionlength')
.array('desc',{
type: 'uint8',
length: 'optionlength'
}),
readUntil: function(item, buffer) {
return item.option === 60
}
});

@yassinjaffer
Copy link

for tftp I used the tftp module and I've done some clean up when the usb is detached
usb.on('detach', function(device){
emitterMod.emit('disconnect', foundDevice);
if(foundDevice == 'SPL' && platform == 'win32'){
dhcp_socket.close();
tftp_server.close();
foundDevice = 'undefined';
}
});

@ravikp7
Copy link
Owner

ravikp7 commented Oct 13, 2017

Hi @yassinjaffer
Were you able to transfer u-boot on Windows eventually?
I couldn't understand your solution, please elaborate more.
It would be good if you share your changes in your fork on github, I can't compare or understand the code (here in comments) completely.

@yassinjaffer
Copy link

yassinjaffer commented Oct 14, 2017

Hi
Sorry for the messy code. Yes I was able to transfer u-boot and subsequently expose UMS.
I will try to send a proper patch.
My solution involves creating a simple DHCP and TFTP socket servers. to handle u-boot transfer.
The DHCP socket server listens on port 67 for bootp packets and then send a reply. These servers will be invoked once a new network interface created( using USB attach listener and os.networkInterfaces).

@ravikp7
Copy link
Owner

ravikp7 commented Oct 14, 2017

Sounds good. Looking forward to it 👍

@ravikp7 ravikp7 removed this from the Windows Support milestone May 23, 2018
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