Possible Theory On Sd Card Formatting...


BradN

Active Member
Joined
Jun 22, 2003
Messages
577
I don't have a gp2x (yet; waiting for hardware issues to get ironed out), but from what I've read on the forums so far, it looks like some people have had better luck with the card "superfloppy" formatted - ie, without a partition table, and the filesystem across the whole disk. (this is how floppy disks are formatted; hence the name)

Lots of cameras and such will format a card like this when you format the SD in them, but windows probably just keeps the same partition table/no partition table layout as it had when you told it to start formatting. Maybe someone with linux or an easy way to format the card in a specific way could test this and report back?

linux command for formatting w/ no partition table:
mkdosfs -F 32 /dev/sda

with partition table:
fdisk /dev/sda
(delete any partitions with d command)
(make new partition with n command)
(change type of partition to type "b" with t command)
w to write partition table and quit
mkdosfs -F 32 /dev/sda1


If this works, maybe an easy way for windows people to get the card formatted would be a disk image writer program and an image file created by someone that's got theirs to work? Even a 1GB image file would zip down to next to nothing if the card was blanked before formatting.
 
BradN posted on Dec 1 2005 at 06:27 PM said:
I don't have a gp2x (yet; waiting for hardware issues to get ironed out), but from what I've read on the forums so far, it looks like some people have had better luck with the card "superfloppy" formatted
No, I tried yesterday both ways, but nothing works.

I really think it all depends on luck.
 
Last edited by a moderator:
Oops, duplicate posted... the forum didn't show the post when I refreshed the first couple times...
 
Damn. Probably crappy SD access code in U-Boot then. But GPH should still be able to make a firmware updater that runs in linux - that should work as long as SD access works correctly in linux, and they have write support for the NAND compiled in the kernel. If someone's brave enough to try, they could try cat'ing a firmware image directly to the appropriate mtd device, but that would be a little scary to attempt unless you've got a JTAG to reload in case it screws up...
 
BradN posted on Dec 1 2005 at 06:27 PM said:
I don't have a gp2x (yet; waiting for hardware issues to get ironed out), but from what I've read on the forums so far, it looks like some people have had better luck with the card "superfloppy" formatted - ie, without a partition table, and the filesystem across the whole disk. (this is how floppy disks are formatted; hence the name)


I managed to get my SD card to be recognized by formatting it on a Windows 2000 machine at work; I can confirm that it now has no partition table. So this seems to be the root of the problem.

This probably deserves an FAQ entry.
 
Last edited by a moderator:
so does anyone know of utilities for XP that can remove partition tables?

I don't particulary want to download linux then accidently format my main hdd because I don't know what I'm doing...
 
Hi all I too had the non flashing problem I tried linux, formatting in my camera through the gp2x (yes i managed to find 1 pc that would recognise it) i tried this with 2 different cards a 1gb Kingston card and a no name 512mb card neither worked. I bit the bullet and bought a 512mb Sandisk card formatted it under windows xp on the same card reader/writer as the previous attempts and lo and behold it flashed my unit first time. I don't see how the problem can be a formatting problem it's gotta be the cards.
 
abigsmurf posted on Dec 1 2005 at 10:25 AM said:
so does anyone know of utilities for XP that can remove partition tables?

I don't particulary want to download linux then accidently format my main hdd because I don't know what I'm doing...

my guess would be the same utility used above in 2000.
 
Last edited by a moderator:
I have a feeling the problems are stemming from it needing either 2 or three things being perfectly correct (as well as perhaps some planets in alignment) - FAT32 formatted, a SD card that U-Boot likes, and there's possibly issues with partitioning. I guess the "good" aspect out of all of this, is that it should be more or less fixable in firmware if GPH adds it to their list of many fixables, although perhaps GPH would elect to not even try to update U-Boot in case it fails and leaves the unit bricked. But even in this case, a firmware flasher under linux should be perfectly possible and could easily be made much more forgiving with filesystem/partition/card types.
 
food for thought:

I read that the MMC standard allows for lack of any sort of partitioning. Maybe it can only read in MMC mode...
 
I think I remember seeing on one post that MMC cards wouldn't work at all to flash from U-Boot, but I could be mistaken.
 
MMC cards wont work for flashing, but they work for usage. My Lexar 64mb MMC card will work for files and stuff, but not for flashing. I borrowed DCGM's card for that.
 
jjk posted on Dec 1 2005 at 07:06 PM said:
I managed to get my SD card to be recognized by formatting it on a Windows 2000 machine at work; I can confirm that it now has no partition table.  So this seems to be the root of the problem.

This probably deserves an FAQ entry.

I can perfectly confirm what jjk says:
Currently the gp2x only likes SD-Cards without a partition table.
GPH should write a fixed firmware, where the gp2x is correctly displayed as a removable storage device and not as a harddisk. Maybe detection by XP then also gets better. Currently its a game of luck or mood of Windows, if the device is detected without a yellow exclamation mark.

Until a fix is found, format your Cards with a card reader and gp2x can read them.
For the flashing problem: I tried 3 different brands of SD-Cards, all formatted EXACTLY the same way. Only one brand did work for flashing.
So maybe this card has a kind of "ID", that UBOOT likes...
Pure speculation.
 
Last edited by a moderator:
If any of the devs have a jtag cable, they should try flashing in linux by cat'ing the firmware image to /dev/mtd/[whichever section number is for that firmware part]. One could obtain a "correct" firmware image for this operation by just performing the reverse - cat'ing /dev/mtd/whatever to a file. (I have no idea if the downloadable update file is a pure image or a program with the image attached)

It would be good for the update script to check if the firmware file is the correct size and possibly md5sum it (if the gp2x has this utility onboard), and remount the root partition read-only (if it was mounted read/write). The headache with doing this is that once the root partition is rewritten to flash, linux probably won't be able to load any new commands from it until the system is reset, so this makes it difficult to automatically reboot the machine after it's flashed, unless some tricks are used to run the programs off the SD card, or pre-load them to a tmpfs in memory. Really all that's needed is some way to get feedback that the flashing's complete, then you can reset the unit.

It seems like most if not all cards can be read in linux, so this should improve compatibility a good amount. Of course this assumes that NAND write support works reliably in the kernel, but then again the U-Boot update output gives so many errors it makes me cringe.

Side note: is firmware updating starting to sound more like a bizarre invocation ritual than a software upgrade? For that many steps/requirements, I'd expect a demonic Tux the penguin to crawl out of the headphone jack, awaiting my orders...
 
Back
Top