Sd Card Horrors


ssj195

Member
Joined
Apr 15, 2006
Messages
78
Hi all,

I just received my GP2x yesterday, and bought a 1GB Sandisk SD card to go with it.

The card was recognised by Linux (kubuntu 6.06) and auto-mounted etc, but the GP2X cannot see/ utilise it at all - it's as if the card was not even plugged in to the GP2X.

Since I don't have a Windows install at home, I fiddled around with fdisk and tried (using another 512MB SD card that does work with the GP2X as inspiration) to format it in the same way. Now, though, neither Linux nor the GP2X recognise it (i.e. Kubuntu doesn't auto-mount it, although I can apparently still mess with it via fdisk), and having come into work where I have a Windows XP computer, it seems that Windows doesn't, either :(

Does anyone have step-by-step instructions for formatting an SD card from Linux so that it will work with the GP2X? I imagined Windows would be my saviour here, but it appears to provide no means whatsoever to interact with the card, whereas my Linux install at home at least still allows me to use fdisk.

The card reader is one I bought from eBay a while back and appears to be identical (in terms of looks, at least) to this one:

http://solarelect.en.alibaba.com/product/5...ard_Reader.html

Edit:

Oh, I forgot - after one experimental fdisk'ing, I found that I could actually navigate the SD card from the GP2X, but the limit on the total size/ number of files I could add to it (via ftp from my Linux box) was hugely limited - like 3 files, totalling no more than 30MB. Any more than this would trigger an error. So it's semi-working, but I obviously haven't formatted it with the correct parameters, and don't know what they would be :(
 
yaustar posted on Jul 6 2006 at 03:26 PM said:
This going to sound REALLY stupid. Are you formatting in Fat32?

Thanks for the response :) I am indeed :)
 
Last edited by a moderator:
X-Code posted on Jul 6 2006 at 04:15 PM said:
Tried using mkfs ? :)

Nope, but thanks for the suggestion - I'll look into it when I get home :)
 
Last edited by a moderator:
*sigh* - the mkfs made it recognisable in Linux again, so thanks for that!

However, mkfs.vfat -F 32 /dev/sdd1 always seems to create a FAT16 file system for some reason. And the GP2X is still completely screwing up with the card - it seems to have cached the old contents and simply won't let them go. Apparently, the solution to this is to manually unmount the SD card on the GP2X, but this doesn't work for me - I get

Code:
[root@gp2x root]$umount /mnt/sd
umount: /mnt/sd: Invalid argument

when telnetting in. Not "Device is Busy" or "File not found" - "Invalid Argument" <_<

Help! :(
 
X-Code posted on Jul 6 2006 at 07:39 PM said:
Try commenting out the mount SD line in /etc/fstab on your GP2X , after that , save and reboot, that should work ... I think :) .

Hehe - no, still no joy, I'm afraid - I can still play the movie file on my GP2X from the SD card that should have been lost ages ago when I formatted the card :rolleyes: Thanks for your continued efforts, though - it's much appreciated :)

This is really really annoying me - I've been looking forward to getting a GP2x for ages, but now I almost wish I'd never gotten one :(
 
Last edited by a moderator:
fdisk -l

Is there a partition named something like sda1 that references the SD card ? , if so remove it via fdisk , don't add a new partition , write changes and after that use mkfs -I to force the prog to use the whole card ... Hope this works :)
 
X-Code posted on Jul 6 2006 at 08:04 PM said:
fdisk -l

Is there a partition named something like sda1 that references the SD card ? , if so remove it via fdisk , don't add a new partition , write changes and after that use mkfs -I to force the prog to use the whole card ... Hope this works :)

Here's the output of fdisk -l on my Linux box:

simon@simonlaptop:/media$ fdisk -l

Code:
Disk /dev/sdd: 1018 MB, 1018167296 bytes
14 heads, 13 sectors/track, 10926 cylinders
Units = cylinders of 182 * 512 = 93184 bytes

   Device Boot	  Start		 End	  Blocks   Id  System
/dev/sdd1			   2	   10927	  994179+   6  FAT16

I'll try out your suggestion now :)
 
Last edited by a moderator:
Ok, the card is still mountable in Linux after using your suggestion, but the GP2X problems still persist - playing videos long deleted, unable to unmount, etc.

Here's what the GP2X's fstab looks like - one odd thing is that the referenced /dev/mmcsd/disc0/part1does not actually exist (but /dev/mmcsd/disc0/ does).

Code:
[root@gp2x root]$cat /etc/fstab
none			/proc		   proc	defaults		0 0
none			/dev/pts		devpts  mode=0622	   0 0
none			/tmp			tmpfs   size=5M		 0 0
/dev/mtdblock/3		 /			   yaffs   sync,noatime,rw 0 0
/dev/mtdblock/4		 /mnt/yaffs	  yaffs   sync,noatime,rw 0 0
/dev/loop/7			 /mnt/nand	   vfat	iocharset=utf8,sync,noatime,rw 0 0
/dev/mmcsd/disc0/part1  /mnt/sd		 vfat	iocharset=utf8,sync,noatime,rw 0 0
 
Ok, I'll admit that I'm lost now, it could be a problem with the card or the card socket, I can't think of anything else at the moment, I suggest that you try another card :) , if I come across anything half helpful I'll let you know.

This is my /etc/fstab

[root@gp2x root]$cat /etc/fstab
none /proc proc defaults 0 0
none /dev/pts devpts mode=0622 0 0
none /tmp tmpfs size=5M 0 0
/dev/mtdblock/3 / yaffs sync,noatime,rw 0 0
/dev/mtdblock/4 /mnt/yaffs yaffs sync,noatime,rw 0 0
/dev/loop/7 /mnt/nand vfat iocharset=utf8,sync,noatime,rw 0 0

/dev/mmcsd/disc0/part1 /mnt/sd vfat iocharset=utf8,sync,noatime,rw 0 0


Go back into fdisk and try re-creating the primary partition again before mkfs, I can't quite figure this out now :lol: , it's weird... But if you remake the partition, all partition info should be changed... Hopefully :huh:
 
Thanks anyway :) In the meantime, here's dmesg when I put my duff SD card into the GP2x. Note the bizarre 484MB
at the end (it's a 1 GB card) :

Code:
MMC/SD Card Detected
###[mmcsd_bus.c:421]->check_sd_ocr: ACMD41 fail!!!
 mmcsd/disc0/disc:CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 0
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 2
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 4
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 6
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 0
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 2
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 4
CMD13 failed, ret =
end_request: I/O error, dev 3c:00 (mmcsd), sector 6
 unable to read partition table
Register SD: 484MB
 
Okey-doke - I've just asked my housemate to format it as FAT32 from Windows XP, and now I get this:

Code:
###[mmcsd_bus.c:421]->check_sd_ocr: ACMD41 fail!!!
Division by zero in kernel.
Function entered at [<c00559c8>] from [<c015f464>]
Function entered at [<c0105314>] from [<c01045b0>]
 r6 = C018C4D0  r5 = C018C58C  r4 = C018C560
Function entered at [<c01044e0>] from [<c0105e28>]
 r6 = C026C000  r5 = C026DF88  r4 = C018C58C
Function entered at [<c0105df0>] from [<c0067568>]
 r4 = C026DF88
Function entered at [<c00674e8>] from [<c0070094>]
 r5 = C0182A28  r4 = C0182A20
Function entered at [<c006ff4c>] from [<c0051fa8>]
Register SD: 0MB

Help! :)
 
I'm still lost, what firmware are you using on the GP2X? :)


GPH release 1.2.0 firmware

// Text borrowed from : http://www.distant-earth.com/gp2x/2006/01/...0-firmware.html

Updates on the Warnings: (Please read this bit)

* The new SD code may cause BIG problems. Look at this debug output below (bold added for interest) from a card that has worked well with all previous firmwares (one that won't support flash upgrades but thats beside the point) I have other cards with the same errors, 3 so far out of my 9 now don't mount cleanly all the time, re-inserting the card helps sometimes.

MMC/SD Card Detected
###[mmcsd_bus.c:414]->check_sd_ocr: ACMD41 fail!!!
Division by zero in kernel.
Function entered at [] from []
Function entered at [] from []
r6 = C01EAE98 r5 = C01EAF54 r4 = C01EAF28
Function entered at [] from []
r6 = C02B6000 r5 = C02B7F88 r4 = C01EAF54
Function entered at [] from []
r4 = C02B7F88
Function entered at [] from []
r5 = C016C670 r4 = C016C668
Function entered at [] from []
Register SD: 0MB
 
X-Code posted on Jul 7 2006 at 06:22 PM said:
I'm still lost, what firmware are you using on the GP2X? :)

2.0. Interestingly, one person (djwillis) had exactly the same problem when the 1.2 firmware was introduced.

Edit:

Oh, and the card is in fact usable under XP - must have been my card reader causing problems, before. So now it's just the gp2x tha is unable to use it :(
 
Last edited by a moderator:
Back
Top