+ Reply to Thread
Results 1 to 11 of 11
Using DFU Tool on Linux using QEMU
This is a discussion on Using DFU Tool on Linux using QEMU within the Rockbox forums, part of the Community Development category; I've done an experiment with my M6 SP on using DFU Tool inside QEMU on Linux. The answer is currently ...
-
05-26-2008 #1Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 PostsUsing DFU Tool on Linux using QEMU
I've done an experiment with my M6 SP on using DFU Tool inside QEMU on Linux. The answer is currently "maybe".
Preparation:
1. Get the USBID of the DFU device: Put the device into DFU mode and connect it to the computer, then use lsusb to see the USBID.
2. Install Windows XP inside QEMU, and then install DFU Tool on it.
3. Copy M6.EBN into the DFU Tool folder in the Windows XP installation.
Steps:
1. Mount usbfs at /proc/bus/usb.
2. Run QEMU as root. Remember to enable the USB option (-usb).
3. Hold the M and Play buttons, then connect the M6 to the computer.
4. Switch to the QEMU Monitor and add the usb device: usb_add host:0419:0141 (the USBID's for other models might be different).
5. Switch back to the Windows XP desktop and run the DFU Tool.
6. See that the device is detected, then press the "Download" button.
My QEMU crashed at this point. This is the dmesg line:
qemu[6429]: segfault at 220a2ec ip b7c40810 sp bfdfddec error 4 in libc-2.6.1.so[b7bd9000+12e000]
That's why I said the answer is "maybe": maybe there is a bug in QEMU that prevents the download process from starting correctly. But there is certainly hope
-
06-13-2008 #2Passing By
- Join Date
- Feb 2008
- Location
- Europe
- Posts
- 6
- Thanks
- 0
Thanked 0 Times in 0 PostsWine?
Excuse my simple question :-) Did someone try to use wine already?
Otherwise, what are the experiences with the opensourcedfu-utils ?
Lastly, we could always reverse engineer the usb protocol in windows and implement it in linux.. although I do prefer an easier solution since time is limited
-
06-13-2008 #3Passing By
- Join Date
- Jan 2008
- Posts
- 3
- Thanks
- 0
Thanked 0 Times in 0 PostsWhat I don't get on wpyh Method:
If you're willing to install WinXP on QEMU, you could as well install WinXP on a different partition and do a dual-boot.
@Wbdsgnr: I think I read somewhere here, that the opensource dfu-utils aren't compatible to the samsung(?) version of dfu the M6 uses
-
06-16-2008 #4Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 PostsI'll answer some of the questions here:
1. I can't speak for markun, but he's tried using wine to run the DFU tool but failed. This is because wine doesn't export the hardware, it just provides the Windows API.
2. I'm installing WinXP on QEMU precisely because I don't want to dual boot. Why should I? Linux gives me a very good working environment, and I feel lost in Windows (XP, Vista, whatever). Dual booting is also very inconvenient. That, and I've allocated the whole harddisk to Linux.
3. The dfu-util software (currently) can't flash the Meizu. I don't know but fnord23 may be right about the dfu versions. From my experiments, it seems to send data to the Meizu, but the player doesn't do a firmware update.
-
06-16-2008 #5
Low-level programs such as DFU tools cannot be emulated because they need direct access to the hardware and an emulator or compatibility layer like QEMU or WINE won't let the program do direct hardware access as it has to pass through them first. I doubt a virtual machine would work either.
-
06-18-2008 #6Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 PostsWell, the DFU tool does access hardware directly, and QEMU has a USB passthrough mode / feature / option. That USB passthrough feature is what I'm using. And since QEMU talks directly with the hardware, I expected it to work.
Now that might mean that the DFU tool tries to disconnect and reconnect the USB again, but I think the crash is due to a QEMU bug.
-
06-19-2008 #7
-
06-20-2008 #8Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 PostsThere is a short description of that feature here: QEMU
Yes, it is indeed buggy, otherwise my post would contain instructions on how to successfully run DFU tool that way.
Yes, this is also a known fact. I forgot to mention that I'm running QEMU on Linux. Sorry for any confusion this might have caused.
-
08-24-2008 #9Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 PostsIt is now possible to do a DFU restore on Linux, using VirtualBox.
Preparation:
1. Install Windows XP inside QEMU, and then install DFU Tool on it.
2. Copy M3.EBN, M6.EBN or M6SL.EBN into the DFU Tool folder in the Windows XP installation.
Steps:
1. Mount usbfs at /proc/bus/usb.
2. As root, loop every 0.5 seconds to chown all the files in /proc/bus/usb to the username you are using.
3. Run VirtualBox. Remember to enable USB support for the VM.
4. Hold the M and Play buttons, wait 2 seconds, then connect the device to the computer.
5. Release the Play button.
6. Connect the device to VirtualBox.
7. Run DFU Tool, then press "Download" button.
8. Unplug device.
Notes:
1. The Play button must be released after connecting the device to the PC, otherwise it will power off after a few seconds.
2. Keep the M button pressed down through the recovery procedure.
3. If anything fails, start over.
-
08-24-2008 #10
So in other words, just forget it because no one wants to buy a second Windows XP license. Seriously, if you're going to do it legally, you need one. Just buy a new miniPlayer/musicCard.
-
08-27-2008 #11Member
- Join Date
- Jan 2008
- Location
- Indonesia
- Posts
- 106
- Thanks
- 0
Thanked 0 Times in 0 Posts(this is very similar to my previous post, but I'll just copy the whole thing to make it easier to follow)
I've figured out the DFU suffix part of the DFU restore operation using VirtualBox on Linux. We would need the current CVS libpcap and Wireshark for this. Wireshark is very helpful here, since it allows us to monitor everything that's going on between the device and the DFU tool.
As always, preparation:
1. Install Windows XP inside QEMU, and then install DFU Tool on it.
2. Copy M3.EBN, M6.EBN or M6SL.EBN into the DFU Tool folder in the Windows XP installation.
3. Download, compile and install the current CVS version of libpcap.
4. Recompile Wireshark against the new libpcap.
Steps:
1. Mount usbfs at /proc/bus/usb.
2. As root, loop every 0.5 seconds to chown all the files in /proc/bus/usb to the username you are using.
3. Run VirtualBox. Remember to enable USB support for the VM.
4. Run Wireshark, then start a capture on the appropriate USB port.
5. Hold the M and Play buttons, wait 2 seconds, then connect the device to the computer.
6. Release the Play button.
7. Connect the device to VirtualBox.
8. Run DFU Tool, then press "Download" button.
9. Unplug device.
10. Stop and save the capture.
Notes:
1. The Play button must be released after connecting the device to the PC, otherwise it will power off after a few seconds.
2. Keep the M button pressed down through the recovery procedure.
3. If anything fails, start over. Remember to restart the capture in Wireshark.
Similar Threads
-
Tipps zum DFU Tool
By Andreas67 in forum GermanReplies: 2Last Post: 02-06-2008, 10:42 PM -
wie benutzt man DFU Tool ?
By qwer in forum GermanReplies: 1Last Post: 12-25-2007, 05:07 PM -
If M3 doesnt have a DFU tool
By fdddd in forum TechnicalReplies: 0Last Post: 12-21-2007, 06:35 AM -
M3 DFU Tool
By paxl13 in forum music card M3Replies: 5Last Post: 11-22-2007, 07:05 PM -
m6_patch_font tool
By Asmo in forum RussianReplies: 28Last Post: 10-05-2007, 05:45 AM



Reply With Quote


