Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Welcome to the Rockbox Technical Forums!

+  Rockbox Technical Forums
|-+  Installation / Removal
| |-+  Manual Installation
| | |-+  Sandisk - Installation/Removal
| | | |-+  Rockbox on e280R with Windows
« previous next »
  • Print
Pages: [1] 2

Author Topic: Rockbox on e280R with Windows  (Read 16188 times)

zajacattack

  • Guest
Rockbox on e280R with Windows
« on: September 14, 2007, 06:26:33 PM »
OK, so I compiled e200tool with cygwin, then I used libusb-win32 to create a driver for the device in manufacturing mode (0781:0720, manufacturer="Sandisk", and device="Sansa e280"). Now, libusb-win32 recognizes it in the "Test Program", and e200tool finds the device. Then, however, e200tool says "Failed to claim the interface, (-22, invalid argument)". Is there a way to fix this (maybe in the driver I made or something in libusb-win32)?
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Rockbox on e280R with Windows
« Reply #1 on: September 14, 2007, 06:49:27 PM »
You should really be testing e200rpatcher, not e200tool - e200rpatcher is the program we need to make run on Windows, and it does less than e200tool, so might work where e200tool doesn't.

But having said that, the problem you're reporting with e200tool is exactly the same as someone else who did exactly the same as you with e200rpatcher.  That's the current hurdle.

You will probably be better off trying to seek help from the libusb-win32 developers.  Maybe post to their mailing list (if they have one), and include a link to the e200rpatcher source, along with a description of what you've done and what the problem is.

EDIT: A quick google points to this page with what looks like a solution:

http://osdir.com/ml/lib.libusb.devel.windows/2006-05/msg00037.html

So you could try adding "usb_set_configuration(dh, 1);" just before the call to usb_claim_interface() in e200rpatcher.c and see if that helps.

EDIT 2: Here's a win32 binary of e200rpatcher with that usb_set_configuration() line added.  Can you let me know what happens now?

http://www.davechapman.f2s.com/rockbox/e200rpatcher-win32.zip
« Last Edit: September 14, 2007, 07:18:19 PM by linuxstb »
Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #2 on: September 14, 2007, 07:31:09 PM »
OK, it ran fine, detected the Sansa and said it uploaded the code. So, where are some step-by-step directions to getting Rockbox on e200R with e200rpatcher. I want to see if it works.
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Rockbox on e280R with Windows
« Reply #3 on: September 14, 2007, 07:34:46 PM »
When e200rpatcher ran, did anything appear on your Sansa's screen?   The patching application should run and display some messages on the screen.  If not, try running e200rpatcher again.

Running e200rpatcher replaces "step 1" in the install instructions - i.e. it patches the Sansa bootloader to allow you to install Rockbox.

Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #4 on: September 14, 2007, 07:35:29 PM »
No, nothing appeared, do I need to hold record while I do it or what?
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Rockbox on e280R with Windows
« Reply #5 on: September 14, 2007, 07:38:18 PM »
No, you don't press RECORD at all - you should just do what e200rpatcher tells you.
Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #6 on: September 14, 2007, 08:03:56 PM »
OK, here's a summary of what happened (p.s. I tried three different drivers made by libusb-win32)

1. When using driver with manufacturer "Sandisk" and description "Sansa e280R", I got these errors:

[ERR] Error writing data length
[ERR] Bulk write error (-5, Input/output error)
[ERR] Upload of application failed

2. When using driver with manufacturer "Sandisk" and description "USB device", it said it was successful, but nothing showed up on my sansa's screen.

3. When using driver with manufacturer "Sandisk" and description "Sansa e280", it said it was successful, but nothing showed up on my sansa's screen.

P.S. Is there a chance that it did patch, but did not write to the screen? If so, should I try loading rockbox?
Logged

Offline chrisjs169

  • Member
  • *
  • Posts: 95
Re: Rockbox on e280R with Windows
« Reply #7 on: September 14, 2007, 08:35:54 PM »
Quote
P.S. Is there a chance that it did patch, but did not write to the screen? If so, should I try loading rockbox?
I tried it on my Sansa - it seems the uploaded code isn't being accepted, because the Sansa 'exists' Manufacturing mode (if you try running e200rpatcher again, it won't find the Sansa until you turn it off/back on) but nothing appears on the screen, and the bootloader isn't patched.
Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #8 on: September 14, 2007, 09:11:19 PM »
OK, if we want this on Windows, someone is going to have to write code that DOES NOT use libusb-win32. It has problems with the device in manufacturing mode. There must be something else that will work better (perhaps DirectX [http://www.adontec.com/driverx_usb.htm] or USBIO development kit [http://www.thesycon.de/eng/usbio.shtml]).
« Last Edit: September 14, 2007, 09:17:56 PM by zajacattack »
Logged

Offline e280ruser

  • Member
  • *
  • Posts: 21
Re: Rockbox on e280R with Windows
« Reply #9 on: September 14, 2007, 10:31:37 PM »
Quote from: zajacattack on September 14, 2007, 09:11:19 PM
OK, if we want this on Windows, someone is going to have to write code that DOES NOT use libusb-win32. It has problems with the device in manufacturing mode. There must be something else that will work better (perhaps DirectX [http://www.adontec.com/driverx_usb.htm] or USBIO development kit [http://www.thesycon.de/eng/usbio.shtml]).

The first link is to DriverX, not DirectX.  Plus, it is non-free, and as far as I can tell closed source.  And  it's the same deal with the other link that you posted.

We have the library, we just need to make it work.  Let's remember that it's not that great of an idea to reinvent the wheel, especially when you're driving blindly.

Quote from: USBIO development kit (http://www.thesycon.de/eng/usbio.shtml)
Developing a kernel-mode WDM driver is considerably different to developing Windows applications. It requires specialist knowledge in kernel-mode programming and a deep understanding of operating system internals. The development and debugging process can be very time-consuming, especially if the driver has to support different Windows versions (e.g. Windows 98, Windows 2000, Windows XP, and Windows Vista).

Libusb is pretty much the only stable (kind of), open source, free library of usb funtions that I have found for windows as of yet, probablly due in part to the large amount of cash needed for the Windows SDK.  Keep looking, and remember, it has to be free.
Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #10 on: September 15, 2007, 01:10:12 AM »
OK, I modified e200tool.c so that it said:

Code: [Select]
usb_set_configuration(ud, 1);
usb_claim_interface(ud, E200_INTERFACE);

Now, it compiled fine and will find my e280R and connect to it fine; however, the usb_set_configuration call does something that causes Windows to disconnect and reconnect the Sansa. So, e200tool cannot do much past initializing the stud before the Sansa is disconnected. For example, when I did "e200tool recover BL_SD_boardSupportSD.rom", e200tool found the Sansa, initialized the stub, wrote the file to the RAM, then lost the connection. This is because there is a small amount of time between the usb_set_configuration call and Windows disconnection, but not much. Plus, it does this on e200tool AND e200rpatcher when they have the call to usb_set_configuration. Now, is there a way to make this call without disconnecting and reconnecting the device?
Logged

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: Rockbox on e280R with Windows
« Reply #11 on: September 15, 2007, 04:14:27 AM »
Quote from: zajacattack on September 15, 2007, 01:10:12 AM
Now, is there a way to make this call without disconnecting and reconnecting the device?
I guess you best ask the libusb-win32 developers about this ...
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Rockbox on e280R with Windows
« Reply #12 on: September 15, 2007, 04:22:07 AM »
Could a Linux user test adding the usb_set_configuration() line to e200rpatcher (see my earlier post in this thread) and see if it still works there?
Logged

zajacattack

  • Guest
Re: Rockbox on e280R with Windows
« Reply #13 on: September 15, 2007, 04:45:37 PM »
I DID IT! My e280R is now running Rockbox, and I patched the BL with e200tool under Windows. Well, I did have to recompile e200tool with the line usb_set_configuration(ud, 1);. Then, the second problem was, I had used inf-wizard to create a driver for the e200R is Manufacturing mode (0781:0720), but when e200tool initializes the USB stub, the device changes to 0666:E200. So, I created another driver for the device under 0666:E200. Then, I followed the directions for patching the BL with e200tool. Now, I am running Rockbox perfectly. I think the same goes for e200rpatcher (there needs to be two drivers).
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Rockbox on e280R with Windows
« Reply #14 on: September 15, 2007, 05:38:51 PM »
That's great news, congratulations.

Would you be able to document the process for installing libusb on windows, and make your two .inf files available somewhere?  

Adding this info to the SansaE200RBootloaderPatching wiki page would be ideal, so we can then work on making an easy install guide.

EDIT: Would you also be able to test e200rpatcher, just to confirm it's working?  The 6666:E200 USB ID is something specific to e200tool, so it would seem that there could still be problems with e200rpatcher.
« Last Edit: September 15, 2007, 05:42:18 PM by linuxstb »
Logged

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Installation / Removal
| |-+  Manual Installation
| | |-+  Sandisk - Installation/Removal
| | | |-+  Rockbox on e280R with Windows
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.085 seconds with 14 queries.