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:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  H120 CF mod - enable UDMA on USB bridge
« previous next »
  • Print
Pages: [1] 2

Author Topic: H120 CF mod - enable UDMA on USB bridge  (Read 11258 times)

Offline dobbley

  • Member
  • *
  • Posts: 9
H120 CF mod - enable UDMA on USB bridge
« on: January 31, 2009, 09:34:01 AM »
Hi,

I've just done the CF mod on an H120, but noticed that the read and write speeds, when attached as a mass storage device, were lower that the card was capable of (R-11MB/s W-5.5MB/s).

I investigated a little and found that the config for the USB ATA bridge had UDMA disabled. I changed config byte 0x0c from 0x20 to 0x3c using the vendor specific USB command, sent a USB reset command, and hey presto the speeds were more than double, and about what I had expected.

Great I thought, now I'll write this value to the I2C config EEPROM (via USB again). No such luck as it seems to be write protected. Does anyone know if there is some other way I can permanently change this value without resorting to a soldering iron, or is the H/W write protect hard wired?

If anyone using a UDMA capable CF wants to see if this speeds things up, the source code is attached. You need to have libusb installed (I was using libusb-win32 0.1.12.1).

Cheers,
dobbley

Edit: I have now added to the wiki on this topic:
http://www.rockbox.org/twiki/bin/view/Main/UDMAonUSB
The code on the wiki supports a wider range of DAPs, and there is a win32 exe for those who want to try this without having to compile.  Please let me know if the mod works on your DAP, but its USB id is not included in the code on the wiki.
* h1x0_usb_udma.c (2.95 kB - downloaded 215 times.)
« Last Edit: February 08, 2009, 09:19:26 AM by dobbley »
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #1 on: February 02, 2009, 09:48:09 PM »
Nice result!  I was going to tell you to put it on the tracker, then realized it's an application you run from your PC that reconfigures the USB-ATA bridge in the H1x0.  Still, this seems better suited to the wiki than here in the forums where it's likely to get lost.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #2 on: February 03, 2009, 06:03:46 AM »
Will do, though first I would be keen to get feedback as to how well this works for others with different set-ups. Then I'll tidy up the code to include all the possibilities.

According to the datasheet wiki, as well as the h1x0, the h3x0, iaudio M5 and X5 all have this ATA USB bridge, so this could speed up CF access when connected to a PC for them too. It may well speed up hard disk read / write time as well when copying files if the drive supports UDMA.

On devices apart from the h120 / h140 you will need to change the idproduct check on line 43 to:0x3001  iHP-100, 0x3003  H320/H340, 0x3004  H340 (mtp).
For iaudio change the idvendor check to 0x0e21, and idproduct to: 0x0510  iAudio X5, 0x0513  iAudio X5, side USB port, 0x0520  iAudio M5.

It would be great if anyone trying this out could post how they get on and the initial read value for config byte 0xc (the code prints out all the config bytes).
« Last Edit: February 03, 2009, 06:34:24 AM by dobbley »
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #3 on: February 03, 2009, 11:27:41 AM »
The Archos recorders with USB 2 use a similar chip.  However, in Vista with LibUSB-Win32 0.1.10.1, USB mass storage devices aren't seen, even if I install the LibUSB-Win32 driver for the device. 

I'm guessing that UDMA is already enabled on my V2 recorder because disk access is very fast.
Logged

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #4 on: February 03, 2009, 01:59:26 PM »
Thanks for the heads up on Vista, I have been using it on XP. Do you still get this problem with libusb-win32-filter-bin-0.1.12.1.exe if you right click and select “Run this program in compatibility mode for” using XP option before installing it?

As you say you are probably using UDMA already if you are seeing greater that PIO mode 4 speeds (16MB/s theoretical, 12MB/s real world).

Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #5 on: February 03, 2009, 03:48:18 PM »
Quote from: dobbley on February 03, 2009, 01:59:26 PM
Thanks for the heads up on Vista, I have been using it on XP. Do you still get this problem with libusb-win32-filter-bin-0.1.12.1.exe if you right click and select “Run this program in compatibility mode for” using XP option before installing it?
I remembered having a lot of trouble installing LibUSB-Win32 on Vista.  Back then, 0.1.12.1 failed even after I ran like that.  Now it installed.  Initially it reported 0.1.10.1 driver version but after a reboot I got the 0.1.12.1 driver. My Archos V2 recorder showed up and your program worked.

Quote from: dobbley on February 03, 2009, 01:59:26 PM
As you say you are probably using UDMA already if you are seeing greater that PIO mode 4 speeds (16MB/s theoretical, 12MB/s real world).
Sorry, I was wrong.  I shouldn't have assumed it is using DMA because it is fast.  Config byte 0xc was 0x64, and your program sped things up significantly. 

I ran cygwin bash as Administrator and measured speed with "dd if=/dev/sdb of=/dev/null bs=1024k count=200".  The default config gave 13.7 MB/s and after running your program I got 24.6 MB/s.  Thanks!!!

Edit: I wrote the EEPROM.  I read it with:
Code: [Select]
usb_control_msg(udev, 0xc0, 0x02, 0x02, 0, &usb_data[0], 0x10, 1000);
I wrote it with:
Code: [Select]
usb_control_msg(udev, 0x40, 0x01, 0x02, 0, &usb_data[0], 0x10, 10000);
I think some timeout other than 0 might have been necessary for the write to succeed.  After that, the read displayed updated data, UDMA was enabled immediately power-on, and reads were fast.
« Last Edit: February 03, 2009, 04:44:49 PM by dreamlayers »
Logged

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #6 on: February 04, 2009, 03:01:03 PM »
Glad to hear you had success with the Archos, and that someone is able to write to the EEPROM. Unfortunately, even with your mod I still can't write to the H120 EEPROM.

Out of interest, I swapped my hard drive back in, and activating UDMA increased the read speed from 12 MB/s to 18 MB/s, not as big a gain but still worthwhile if transferring a few GB.

Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #7 on: February 04, 2009, 03:56:10 PM »
If you're unable to write to the EEPROM, I suspect that it is write protected via its write protect pin.  See http://www.ic-on-line.cn/IOL/datasheet/24LC01_257386.pdf .  I guess on the ATA board (see large scan), U4 is the EEPROM and R18 is the pullup resistor for write protect.  These are just left of the USB connector.  Above the IC is a circular silvery pad with the letters WP below it.  I can't see what it connects to, but I suspect it connects to the write protect pin, and if you ground it, you should be able to write to the EEPROM (normally, via USB and the ISD-300).  I would first at least use a DMM to make sure the pad connects to the pin and that there is some reasonable resistance between it and VCC.
« Last Edit: February 04, 2009, 03:57:49 PM by dreamlayers »
Logged

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #8 on: February 04, 2009, 05:12:05 PM »
Thanks dreamlayers, good call, I have now managed to write.

Thought maybe the write protect pin could be responsible, but I would have to dismantle and solder as the ATA board needs to be removed from the main board to see the side in the photo. As you pointed out it was next to the USB connector, I realised that you can see the resistors just by pulling the end off the iriver. Unfortunately the WP pad is hidden by the main board.

Using some very fine insulated wire, with just a tiny bit of the core poking out and angled down, measured the resistance at 10KOhm. So then took a deep breath, grounded one end of the wire and put the other in place at the EEPROM side of the resistor. Powered on with USB in place, ran the code, success! Powering off so I could take the wire out without chancing hitting VCC was the hardest part. The sequence I used was remove USB from PC, hit reset (to get out of ATA 80 error from USB bootmode), then power off normally.

It would be great if anyone can see an easier way to ground the pin, as this approach is definitely not for the faint hearted, or jittery of hand.
« Last Edit: February 04, 2009, 08:05:22 PM by dobbley »
Logged

Offline amiconn

  • Developer
  • Member
  • *
  • Posts: 176
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #9 on: February 15, 2009, 08:01:01 AM »
I just tried your UDMA setting tool on my Archos Recorder v1 (USB2.0 model). The program is able to find the recorder, and seems to set the ISD config bits properly.

However, even though the harddrive should support up to UDMA5 (it's an 80GB IBM IC25N080ATMR04), windows is unable to access the disk when the bridge is set to UDMA4. Maybe it's the wiring, or a problem with the revision of the bridge?

It would be nice to have an option (or a version of the tool) that limits the setting to UDMA2.
Logged
Jens

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #10 on: February 16, 2009, 02:29:10 PM »
I have added the option to select the UDMA mode (v0.9.1). According to the data sheet this just selects the write mode, and the drive sets the read mode. It does make a difference to the read speed for me though.

It is possible that Archos did not add in the DMA specific tracks from the IDE connector when they went from ISD-200 to ISD-300. Let me know how you get on.
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #11 on: February 16, 2009, 10:15:55 PM »
Quote from: dobbley on February 16, 2009, 02:29:10 PM
It is possible that Archos did not add in the DMA specific tracks from the IDE connector when they went from ISD-200 to ISD-300. Let me know how you get on.
That reminds me:  the schematic in the wiki shows no connection to DMA-related pins.
Logged

Offline dobbley

  • Member
  • *
  • Posts: 9
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #12 on: February 17, 2009, 04:41:38 AM »
That may not mean anything as the USB 1.1 ISD-200 is used in that schematic. It has no UDMA support, and no DMA-related pins to connect to.
Logged

Offline amiconn

  • Developer
  • Member
  • *
  • Posts: 176
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #13 on: February 22, 2009, 08:06:08 AM »
I've added some more test results to the wiki. The iAudio X5 and M5 have UDMA already enabled, so there is no need for using the tool. I couldn't test iAudio M3 because its USB VID/PID is missing in the tool.

Please add VID=0x0e21, PID=0x0500 (iAudio M3) to the tool for testing. The X5 "side port" ID in turn should be removed. This goes to the OTG chip, not the ISD300. I could add it myself, but I don't know what's needed to build the tool.

Unfortunately you seem to be right about the necessary pins for UDMA not being connected in the Recorder V1 (USB2.0). And since those signals are timing sensitive, wiring them doesn't seem to be like a good idea.
« Last Edit: February 22, 2009, 08:14:08 AM by amiconn »
Logged
Jens

Offline bluebrother

  • Developer
  • Member
  • *
  • Posts: 3421
  • creature
Re: H120 CF mod - enable UDMA on USB bridge
« Reply #14 on: February 22, 2009, 11:09:37 AM »
I managed to get the program run on linux with only some slight changes. Haven't done speed tests yet but it seems to work fine. IMO it would be nice to have this a patch in Flyspray to get it into svn as official tool. I'll post my changes later (I'm quite busy this weekend).
Logged
Rockbox Utility development binaries (updated infrequently) · How to ask questions the smart way · We do not estimate timeframes.

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Hardware
| | |-+  H120 CF mod - enable UDMA on USB bridge
 

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

Page created in 0.096 seconds with 15 queries.