Tuesday, July 21, 2009

USB ethernet is broken

As many of you have reported, the USB ethernet gadget device didnot work with Windows. This is due to a kernel bug which was fixed in (thanks to mofive for pointing this out). I've backported the trivial fix and now the A320 is detected as network device and the drivers seem to work with Windows at a first glance.

However, something else is badly broken: if you start a file transfer (from the A320 to the PC to keep the flash write delay out of the measurement) you'll see a high sustained throutput for a few seconds (about 40Mbit/s), and then the link crashes. In linux the link recovers after a delay, in windows the crash is permanent until you unplug and plug again the USB cable.

(note: iperf is available in the rootfs, you can use it to test transfer without using FTP)

The bug may be in the ethernet gadget code itself or in the JZ4740 USB driver code. I've traced the evolution of the ethernet gadget code through all subsequent kernel versions and there seem to be some fixes I could use. I intend to first try to backport these fixes and see it this solves the problem. If it does not, I'll then look to the JZ4740 USB driver code.

I will be releasing a new rootfs/toolchain tomorrow which will include the mentioned USB ethernet gadget fix to work with windows (but remember, it is broken anyway) and a modified SDL library that no longer requires "export SDL_NOMOUSE=1".


  1. Can it be done that ~/ links to /boot/home or some other dir on the fat partition?
    Some games (duke3d) require to have a config dir in ~/

    Also, I just noticed, that ~/ currently leads to /, is there any way to change home dir location?

  2. Big thanks for your work, Booboo :)

  3. @zeartul

    My mistake. No environment variables are set at all, and at least $HOME should be set. I'll be fixing this in the next release. Meanwhile,, you're most likely using a shell script as /usr/local/sbin/main, so edit it and add something like "export HOME=/usr/local/home" (and make that directory).

  4. Just some additional information regarding the transfer/USB bug:
    I could never complete any large file transfers with z-modem using Tera Term Pro under WinXP. Out of 20 attempts or so, only one small file succeeded.
    The symptoms are very similar to what you describe. Initial short burst of activity and then everything hangs. I usually would have to reboot the Dingoo and restart Tera Term to make everything work again. In the end I gave up and just transferred using the native O/S transfer (which was a major pain).

  5. fyi the issue of tremor not being properly installed by buildroot into the toolchain should be fixed soon, http://bugs.busybox.net/show_bug.cgi?id=387

  6. Whould shaping traffic with iptables to, say, 10mbps help as an intermediate fix?

  7. Has anyone tried traffic shaping to see if that helps?