Gp2x Does Not See 4gb Sd Card On First Boot, But Does On Second Boot


Super Jamie

Still Fresh
Joined
Feb 26, 2007
Messages
80
Age
40
Location
Brisbane, AU
Website
linuxaleph.blogspot.com
I have a SanDisk Ultra II 4Gb SD Card, in a MkII GP2X with Firmware 2.1.1, the card has been formatted FAT32 with an SD Reader in Windows XP.

If I copy files to the SD Card, and start the GP2X, and use Games, Explorer, etc, the SD Card menus appear empty, and nothing happens if I go Settings / USB. If I flick the power off and on again, the GP2X boots, then sees the SD Card fine, and USB functions as normal.

This seems to happen when re-inserting the SD Card after having it ejected, and when the GP2X has been powered off for a period of time (5 minutes or more).

I have a normal SanDisk 1Gb card which functions perfectly, and does not have the issue described above.

The SanDisk website indicates that all current-model 4G SD Cards are SDHC, with the part number "SDSDRH-4096", however mine has the part number that corresponds with the older SD Card spec, as seen on earlier 512Mb-2Gb cards, "SDSDH-4.0". The packaging has the older SD(tm) logo, not the newer SDSH(tm), so I'm pretty confident it's not an SDSH card. (Although SD Association claims any 4Gb card is either SDSH, or non-compliant SD/SDSH)

Any ideas? My first assumption is flaky firmware compatibility. Perhaps I should just get two older 2Gb cards and swap between them as required...
 
Due to way SD cards work, it's not possible to have a 4GB card that not SDHC and be compliant to the specification. You have to play with the CSD fields and adjust the block sizes/etc, something I wouldn't have thought Sandisk would do, considering they are a member of the SD Org.

Still, stranger things have happened!
 
I have been doing some light reading, and found this:

The third limit was set by the SD Association: To ensure wider compatibility, FAT12 and FAT16 were defined as the standard fileystems for SD cards. According to the strict FAT16 rules, there can be a maximum of 65524 clusters available in a FAT16 filesystem, and the maximum cluster size is 32kB. This leads to a limit of 1.999GB for a FAT16 filesystem.

But the parameters of a FAT16 filesystem allow a number of up to 128 sectors per cluster, giving a cluster size of 64kB on a standard media with 512 bytes per sector. This allows FAT16 filesystems of up to 3.999GB. There are many devices with support for 64kB cluster size, but according to the FAT specification, this is not mandatory. Most likely, the 32kB limit was just set to have a defined limit for the cluster buffer in devices supporting FAT16.
Hopefully I can trick it with a smaller (64kb) cluster size, perhaps under FAT16. I might give ext2 a shot as well.

Very helpful, thank you muchly for the tip :) I'll post my findings in a few days.
 
FAT16 file system (with 64K cluster size) definitely works with 4GB cards on GP2X. I have been testing various options for awhile. It was weird formatting on Windows XP though. I had to tell it to use FAT, but not specify cluster size. If I told it a cluster size to use, it disobeyed completely and formatted in FAT32.

Anyone know how I can format my SD to EXT2 file system if I don't use Linux? It's my last resort in getting a very stubborn SD card to work that I have. I have tried a Knoppix boot CD, but it wouldn't work on my system.

I thought someone might know of a format utility...
 
I have a Ridata 4GB card (not SDHC, at least there no logo on it saying that) that I'm trying to get up and running. I don't have XP, though. Is it possible to format it properly on a Windows 2000 machine? When I right-click format, my only options are "FAT", "NTFS", and "FAT32". How would do a FAT16 format, if that's even possible on Windows 2000?
 
Project37 posted on Mar 10 2007 at 01:36 AM said:
How would do a FAT16 format, if that's even possible on Windows 2000?
FAT = FAT16 They are the same thing. FAT is actually the correct term, but some people say FAT16 to distinguish from FAT32.

However, If I were you I wouldn't use FAT16 unless you have a special reason. FAT32 is better for cards greater than 2GB in size.
 
Last edited by a moderator:
You have to use something more advanced than Windows' format tool, DD might be what you are looking for. Its mainly a Linux tool, but there is a port for the Windows Command Prompt (...like DOS but more advanced).

As for EXT2, you can't access it in Windows without a special driver (www.fs-driver.org), and even then you can't format it. So if you're doing that you should have a little experience with linux and be willing to boot it up (you could set up a Ubuntu + Windows XP dual boot system, for example).
 
This SD card certainly is stubborn!

It won't format FAT16 w/ 64K cluster under WinXP, command line format errors saying this isn't compatible with the file system. I don't know why, linux fdisk reports the partition table as 4069Mb, which is under the 3.999Gb (4094Mb) limit of FAT16 file systems.

My properly-working 1Gb card has the partition type of W95 FAT32 (LBA), so I used linux fdisk to create a partition table as W95 FAT16 (LBA) on the 4Gb card, and used mkdosfs to specify FAT 16, 512 bytes per sector, 128 sectors per cluster (128*512=64kb clusters).

This reads fine under linux, however gparted tells me i have no partitions, and it comes up "Memory Card Error" in my digital camera (Canon S2IS, which I read has issues reading non-FAT32 4Gb cards anyway). I still get the same appears-on-second-boot result in the GP2X as well.

I tried formatting the 4Gb card as ext2, but it didn't even list files. I also believe gp2xmenu mounts SD cards as -t vfat, fixing this would involve adding a mount -t auto to the /etc/profile script on the GP2X and manually launch gp2xmenu, which is not something I'm willing to do incase I make the thing unbootable. (tho i guess i could always just re-flash firmware from the working 1Gb card...)

I tried writing a script which remounts the SD card, and put it on NAND. So I boot, the SD card doesn't appear, I run my script to remount it, and... it still doesn't appear until next boot.

I don't really believe this problem has anything to do with the file system on the SD card, and is a fussy firmware / non-compliant SD card issue, and I don't really fancy writing a new driver to send low-level CSD commands to the card.

The only other thing I can think of at the moment is to specify a smaller partition (say 3.5Gb) and try format that FAT32 and FAT16 and see what happens. I'll give that a go as soon as I figure out why the 4Gb card doesn't appear in gparted anymore.

imhotep posted on Mar 9 2007 at 08:40 PM said:
FAT16 file system (with 64K cluster size) definitely works with 4GB cards on GP2X. I have been testing various options for awhile. It was weird formatting on Windows XP though. I had to tell it to use FAT, but not specify cluster size. If I told it a cluster size to use, it disobeyed completely and formatted in FAT32.

Anyone know how I can format my SD to EXT2 file system if I don't use Linux? It's my last resort in getting a very stubborn SD card to work that I have. I have tried a Knoppix boot CD, but it wouldn't work on my system.
When I tried under Windows, I specified both FAT16 and cluster size.

Try an Ubuntu LiveCD, or something like SLAX or Damn Small Linux may also do what you're asking, I'm not sure how their USB support is. If the Knoppix/Ubuntu CD won't work on hardware, you could probably run it under VMWare (now freeware) and give the Virtual Machine USB focus while you partition and format the card. If it helps any, I'm using gparted under Ubuntu to do my partitioning.

In regards to changing to ext2, I also can't be bothered dealing with setting executable flag on every program I copy to the card, and ensuring "others" have read permissions to every file I put on there. You may wish to take these things into consideration as well.

Project37 posted on Mar 10 2007 at 12:36 AM said:
Is it possible to format it properly on a Windows 2000 machine? When I right-click format, my only options are "FAT", "NTFS", and "FAT32". How would do a FAT16 format, if that's even possible on Windows 2000?
FAT means FAT16, however to specify cluster size, etc you are better using the command line format tool:

Start
Run
cmd
OK
format /?

You could also do it via Disk Management. Right click on My Computer, choose Manage.
 
Last edited by a moderator:
Super Jamie posted on Mar 10 2007 at 07:16 PM said:
The only other thing I can think of at the moment is to specify a smaller partition (say 3.5Gb) and try format that FAT32 and FAT16 and see what happens. I'll give that a go as soon as I figure out why the 4Gb card doesn't appear in gparted anymore.
Same deal, 3.5Gb FAT16 works on second boot, as does 1.5Gb FAT16.

I give up, I'll just buy a proper 2Gb SD card.

Thanks for all the help anyway guys. I'll add this to the Wiki sometime.
 
Last edited by a moderator:
Super Jamie posted on Mar 10 2007 at 08:16 PM said:
When I tried under Windows, I specified both FAT16 and cluster size.
That's what I said not to do. Just tell it FAT, but don't specify cluster size.

Windows XP command line would be:

format <drive letter> /fs:FAT

It will give you a warning about cluster sizes later on (bad for compatibility, etc.), but tell it to go ahead and you will have a FAT16 file system with 64K clusters. It's a bug in Windows XP that you can't specify 64K cluster size, but at least there is a workaround.

And yes, the GP2X is fine with 64K clusters. Just don't try and read the card on Win98.

P.S. Thanks for the advice re Linux. I will take my faulty card back to the shop. It all sounds too hard and EXT2 was a long shot for me anyway.
 
Last edited by a moderator:
You don't want it ext2 - the stock firmware can't automount anything other than FAT(32).
 
One could modify fstab all the shell scripts so they mount the sdcard as -t auto if you wanted, but it's alot of stuffing around.

Hmm, interesting, I'm just going thru the file system and it appears fw 2.1.1 mounts everything as noatime from the factory, so that dude's patch is now obsolete...
 
I know, I wrote some instructions to do it a while back :) But I've explained other reasons not to use ext2 in other threads.
 
Thanks everyone, for your time and feedback!

imhotep posted on Mar 10 2007 at 02:33 AM said:
FAT = FAT16 They are the same thing. FAT is actually the correct term, but some people say FAT16 to distinguish from FAT32.

However, If I were you I wouldn't use FAT16 unless you have a special reason. FAT32 is better for cards greater than 2GB in size.

Ah, thanks for the clarification! :)

Super Jamie posted on Mar 10 2007 at 05:16 AM said:
FAT means FAT16, however to specify cluster size, etc you are better using the command line format tool:

Start
Run
cmd
OK
format /?

You could also do it via Disk Management. Right click on My Computer, choose Manage.

Hmm. I tried both of those options, but Disk Management wouldn't finish the format because of the cluster size. The command line option finished, I dragged a folder of pictures onto the disk as a test, but the GP2X still wouldn't read it. I tried both FAT and FAT32, but no luck on either.

On a side note, I also tried sdfv2000.exe from sdcard.org, but that didn't seem to work either.

Blah posted on Mar 10 2007 at 03:21 AM said:
You have to use something more advanced than Windows' format tool, DD might be what you are looking for. Its mainly a Linux tool, but there is a port for the Windows Command Prompt (...like DOS but more advanced).

I'd like to try this, but as a complete Linux virgin, this is a bit too intimidating for me. I think I found what you were talking about at http://www.chrysocome.net/dd, but it's not immediately clear how I'd use it to format the disk.

I know that this specific card model and size works on the GP2X (a friend of a friend uses it and recommended it to me, plus it's marked as such on the GP2X wiki). At first I thought I had a defective card, so I exchanged it for a new one (the one I'm working with now). I don't think that I drew two duds in a row, so I'm sure it's a question of formatting.

Also, I realized that I forgot to mention I'm running FW 2.0, although I don't think that presents an issue (the Ridata 4GB card is checked off for 2.0 on the wiki).

Thanks again!
Brian
 
Last edited by a moderator:
So, Project37, are you saying that the card is fine in Windows, but is not recognized at all by GP2X?
 
imhotep posted on Mar 13 2007 at 05:40 AM said:
So, Project37, are you saying that the card is fine in Windows, but is not recognized at all by GP2X?

That's exactly right. Not sure where I'm going wrong?
 
Last edited by a moderator:
Changing your firmware might be your only chance, but it's not looking good...

Edit: Do other (smaller) SD cards work fine in your GP2X?
 
imhotep posted on Mar 13 2007 at 08:04 PM said:
Changing your firmware might be your only chance, but it's not looking good...

Edit: Do other (smaller) SD cards work fine in your GP2X?

Yep, I've got a SanDisk 1GB card that I right-click formatted as FAT32 on a Windows 2K machine. Works just fine! :)

As far as upgrading goes, my only reference is the SD Card table on the GP2X wiki. According to the table, FW 2.0 *should* be okay with the RiData 4GB card (and an identical card is working on my friend of a friend's FW 2.0 machine).

As a complete novice, I have to ask, would a Windows XP machine format it differently somehow?

Thanks for your patience and your help! :)
 
Last edited by a moderator:
Project37 posted on Mar 14 2007 at 11:34 AM said:
(and an identical card is working on my friend of a friend's FW 2.0 machine).
See if you could lend your friend your card to see if it will work for him (or if he can format it to work somehow).
 
Last edited by a moderator:
imhotep posted on Mar 15 2007 at 03:44 AM said:
See if you could lend your friend your card to see if it will work for him (or if he can format it to work somehow).

Yeah, I was thinking the same thing. Unfortunately, the turnaround time will take ages (not someone I see that often). If I can get it sorted out, I'll post back here so if someone else runs into the same issue, they'll have a reference as to what to do. I may even just splurge on a different brand (the Transcend 4GB card is another model that's supposedly good, according to the wiki).

Thanks again!
 
Last edited by a moderator:
Back
Top