• Status Closed
  • Percent Complete
  • Task Type Patches
  • Category Drivers
  • Assigned To No-one
  • Operating System Another
  • Severity Low
  • Priority Very Low
  • Reported Version Version 3.3
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by shotofadds - 2009-07-08
Last edited by shotofadds - 2009-08-12

FS#10415 - Cowon D2 SD(HC) driver

WARNING: This driver has not been widely tested and it may eat your SD cards. You have been warned, TRY IT AT YOUR OWN RISK!

This is a read/write SD(HC) card driver for the D2. It isn’t complete, but it seems to work, and it seems reasonably fast (~7MB/s real-world read from a file).

There is NO hotswap ability yet, so you need to have the card inserted before bootup. It also doesn’t support MMC cards.

The attached patch uses an SD card INSTEAD OF the internal flash. In order to use both drives, the multi-driver rework ( FS#9545 ) will need to be finished and applied.

I’ve tested this driver with a couple of different cards (SD and SDHC) without problems. Files seem to be saved correctly and chkdsk didn’t report any problems.

However, when this driver was at an earlier stage of development (and contained more bugs than it does now!) I did manage to accidentally destroy my main 16Gb SDHC card.

So be warned, be careful which cards you use!

   sd.diff (18.6 KiB)
The task depends upon
ID Project Summary Priority Severity Assigned To Progress
9545 Rockbox  FS#9545 - Storage cleanup and multi-driver support  Very Low Low
Closed by  shotofadds
2009-08-12 21:15
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

This is now enabled in SVN

The attached version integrates with the multi-driver patch to provide access to both SD and NAND drives. Make sure you apply  FS#9545  first.

With this version the SD card becomes the primary drive, so features such as saving settings/playlists/database etc etc work properly like they do on other Rockbox targets. Files on the internal flash drive are accessible by going to “<microSD1>” in the file browser (yes I know this is mis-labelled!)

Once you have updated the bootloader, you will need have an SD card with .rockbox folder inserted in order to boot Rockbox. I don’t think that’s too much to ask for the benefit of being able to save your settings/playlists… ;-)

I’ve also added support for hot-swapping SD cards to this version - although I haven’t tested this much. We’ll have to wait & see to find out how well Rockbox copes with swapping out the primary drive while running (just make sure you have the same version of .rockbox on both cards…!)

File read access seems to be generally faster with SD than from NAND, but the initial FAT mount / bootup seems to take longer from the SD card. I’m not sure why this is.

I’ve noticed a strange problem with one of my cards (a 16Gb Transcend SDHC). The FAT mount takes *ages* (and I guess eventually times out and fails), and when Rockbox eventually boots, it boots from the internal NAND instead of SD. The only files listed in the Files menu are from the internal flash. BUT the weird thing is, if I then hotswap to this card it works fine!

I need to do some more debugging :/

The attached v3 patch fixes the above problem - all 4 cards I tested now work properly at bootup, with no excessive delay.

Update to sync with  FS#9545  v8, and to remove any remaining ambiguity between drive numbers and card numbers.

NOTE: If you boot with an SD card inserted and then remove it, there is currently a bug where you can’t access files on the internal NAND either until you insert a card again. Need to look into this…

This probably breaks compiling for the simulator; if so try moving the HAVE_MULTIDRIVE, HAVE_HOTSWAP & NUM_DRIVES defines into a #ifndef SIMULATOR block.

I ran into that myself yesterday and did the same change. I’ll commit the patch with this fix included later today.

For clarity, the remaining issues are:

1) Files on the internal memory (NAND) are found under “<microSD1>” in the File browser (this is just a display issue)

2) If you boot with an SD card inserted, and later remove the card, the File broswer won’t show any files at all (not even those on the internal memory). All files become available again when you re-insert the card. I guess there’s an assumption somewhere in the File browser code that drive(or volume?) 0 will always be present.

3) MMC cards are not supported. This driver is based on the PP microSD driver, which does not support MMC cards. MMC support could be added later, if there are actually D2 users who use these cards.


Available keyboard shortcuts


Task Details

Task Editing