Experimental Sdhc Support For Gp2x


notaz

Certified Guru
Joined
Aug 23, 2005
Messages
4,913
Location
Lithuania
Website
notaz.gp2x.de
Update: I've backported 4.0.0 SDHC code (was only copy-paste, really), you can download new patch here, and source here. The SDHC support in this update should be exactly the same as in GPH 4.0.0 firmware, so this update should have the same card compatibility as 4.0.0 firmware. This kernel also has read-ahead disabled, as it causes problems with software, which tends to stream data from SD card. Haven't noticed any bad effects because of this.

Short history of this patch: my previous patch was merged by DJWillis with his code, and went into Open2x. GPH took that code and merged it into their 4.0.0 firmware, after that I took it back and merged with 2.1.1, what resulted in a thing you can download above.

Updated readme:
Code:
About
-----

This is a modified GP2X firmware 2.1.1 kernel with SDHC SD card support
for F100 GP2Xs. It also has read-ahead disabled by default, which is
better for apps, which do data streaming from SD card.

The SDHC code used is exactly the same as in GPH 4.0.0 firmware, which is
my code with some enhancements by DJWillis (Open2x).

WARNING: this update involves flashing kernel area in your GP2X NAND.
While this should be reversible, because boot loader (the vital part)
should not get harmed, small chances of bricking exist.
Do not use this on GP2X versions other than F100, as it will cause some
things (like touchscreen) not to work.
I TAKE NO RESPONSIBILITY IN FLASHING YOUR GP2X. DO IT AT YOUR OWN RISK.

- notaz


Installing
----------

Format your SD card with FAT32 filesystem, then copy ONLY gp2xkernel.img
from this archive to the root (main) directory. The SD card used for
updating must NOT be SDHC, and it must be firmware update compatible.
See the page below for details:

http://wiki.gp2x.org/wiki/SD_card_compatibility

The procedure is similar as of firmware update. Turn off your GP2X, insert
the card, press START and SELECT and while holding them turn on your GP2x.
Then "firmware update" (or similar) screen should appear. When this finishes,
restart your GP2X, it should boot exactly as before, but start supporting
SDHC cards.


Uninstalling
------------

Download firmware upgrade files of firmware you were previously using. Take
only gp2xkernel.img from the firmware upgrade and copy it alone to your SD.
Then repeat the update procedure you have done before. Everything should go
back as it was before.

Old post below:

I recently bought a 4GB SD card and well it was SDHC. So I hacked up a quick support for SDHC. I know DJWillis was working on this, and probably achieved similar results, but I wanted to do it myself.

To test it out, you have to flash my custom kernel, because gph has built SD card support into kernel (instead of building it as a module). This involves some risks, but should be easily reversible.
The kernel is based on kernel from 2.1.1 firmware here.

Older, download here.
The source changes to this kernel are here.
 
I also patched ART103's bootloader, the source patch is here. This allows it to boot kernel from SDHC and other SD cards, which have larger block sizes (I have one such 2GB card, which was not working with ART103's bootloader). It boots ok if the only file in card is the kernel image, but if there are more files, it sometimes fails.

I am not providing binary image for this, because the only guys interested in this should be kernel devs (probably Open2X coders). Also because of bricking dangers when updating bootloader.
 
Very cool stuff... I'd help you test but at the moment I don't have any SDHC cards, I'll see if I can get one to help out testing and bugfixing and whatever.
 
notaz,

I have been doing just the same with the current Open2x SVN code (basic SDHC support is in there but proving flakey with one of my 4GB cards, other is fine).

Do you have any issue with me mergeing your changes with mine and adding them into Open2x SVN? Failing that, want to help out with Open2x? :D.
 
SNAFU.

I would buy an 8 GB SD card when I know that the GP2X would work with them. I don't know if they work because I cant test until I buy an 8 GIG card :p
 
DaveC posted on Mar 8 2007 at 06:07 PM said:
SNAFU.

I would buy an 8 GB SD card when I know that the GP2X would work with them. I don't know if they work because I cant test until I buy an 8 GIG card :p

8 Gig's are working with my patch (slow, not well tested) and looking at Notaz’s patch it is very similar (with MUCH better code then mine ;)) so I would think it would be good but I guess I should stump up another £45 for the 8GB SDHC rather then trashing cards work bought for other stuff :D.
 
Last edited by a moderator:
Hmm well now with GBA emus comming along, and card guzzling Sega CD games we really need an 8 GB card to work. Good luck getting it going faster more reliable etc.
 
DJWillis posted on Mar 8 2007 at 07:48 PM said:
notaz,

I have been doing just the same with the current Open2x SVN code (basic SDHC support is in there but proving flakey with one of my 4GB cards, other is fine).
Have you tried your cards on my patch?

DJWillis posted on Mar 8 2007 at 07:48 PM said:
Do you have any issue with me mergeing your changes with mine and adding them into Open2x SVN? Failing that, want to help out with Open2x? :D.
No problem with that, you can consider the patch as public domain and do whatever you want with it. We just don't know if the code works (I only know it works with my SDHC..)
 
Last edited by a moderator:
notaz posted on Mar 8 2007 at 08:32 PM said:
DJWillis posted on Mar 8 2007 at 07:48 PM said:
notaz,

I have been doing just the same with the current Open2x SVN code (basic SDHC support is in there but proving flakey with one of my 4GB cards, other is fine).
Have you tried your cards on my patch?

Not yet, just taken my patch out and was going to test yours in a min before I look to hack them together. It may need a tiny bit of help to build with the 2.4.26 kernel we use in O2X but does not look that hard.

notaz posted on Mar 8 2007 at 08:32 PM said:
DJWillis posted on Mar 8 2007 at 07:48 PM said:
Do you have any issue with me mergeing your changes with mine and adding them into Open2x SVN? Failing that, want to help out with Open2x? :D.
No problem with that, you can consider the patch as public domain and do whatever you want with it. We just don't know if the code works (I only know it works with my SDHC..)

Cool :D.
 
Last edited by a moderator:
notaz posted on Mar 8 2007 at 08:32 PM said:
DJWillis posted on Mar 8 2007 at 07:48 PM said:
notaz,

I have been doing just the same with the current Open2x SVN code (basic SDHC support is in there but proving flakey with one of my 4GB cards, other is fine).
Have you tried your cards on my patch?

Ok, here goes...

4GB DataWrite SDHC - Works
4GB Unknown SDHC - Fails (finds the card every time but that is about it)
8GB DataWrite SDHC - Fails (finds the card sometimes but gets no further, i.e. hangs)

Looking at the code and the fact you where kind enough to patch SDK2X (so debugging should be a lot easier :D) I think it should not be to hard to track down the bugs and smooth off the rough edges. I will start to merge the patches together tonight and see what we get with the combined effort.
 
Last edited by a moderator:
SDK2X has a good debug output support, so just bumping up the debug level should show exactly where it fails.

If the cards are detected, maybe they just need to be reformatted to work?
 
OMG I'm sooo glad I noticed this. I've got two 4gig SDHC cards that I got a while back when people were going on about the great SD card deal - never got round to sending them back (I also bought an expensive Card reader just to see if I could get these working). If this update makes them usable I'm going to be VERY happy indeed (and I'll jump straight over to paypal). did the update and now I'm just copying stuff onto my 4gig card, so I'll find out in a min... ooh this is very exciting :D

EDIT: Darn, doesn't work :( That's a Dane-elec 4gig btw. Oh well, maybe someday. Thanks though Notaz, it's great to know there are some people who really care about making the gp2x a better machine (wonder when gamepark will increase their sd card support) :)
 
notaz posted on Mar 9 2007 at 03:57 PM said:
SDK2X has a good debug output support, so just bumping up the debug level should show exactly where it fails.

If the cards are detected, maybe they just need to be reformatted to work?

Yep, I helped with the original work on SDK2X so I am very familiar with the debug output (I even have some test apps designed to parse and work with just that output from when I was working on MMC support for some very odd MMC cards, just need to find it).

Godmil posted on Mar 9 2007 at 05:44 PM said:
OMG I'm sooo glad I noticed this. I've got two 4gig SDHC cards that I got a while back when people were going on about the great SD card deal - never got round to sending them back (I also bought an expensive Card reader just to see if I could get these working). If this update makes them usable I'm going to be VERY happy indeed (and I'll jump straight over to paypal). did the update and now I'm just copying stuff onto my 4gig card, so I'll find out in a min... ooh this is very exciting :D

EDIT: Darn, doesn't work :( That's a Dane-elec 4gig btw. Oh well, maybe someday. Thanks though Notaz, it's great to know there are some people who really care about making the gp2x a better machine (wonder when gamepark will increase their sd card support) :)

Interesting that they fail, would you be interested in testing an Open2x kernel with a combination of Notaz and my patches? My cards are also cheap'o DaneElec cards from 7DayShop.
 
Last edited by a moderator:
Godmil posted on Mar 9 2007 at 05:44 PM said:
EDIT: Darn, doesn't work :( That's a Dane-elec 4gig btw. Oh well, maybe someday. Thanks though Notaz, it's great to know there are some people who really care about making the gp2x a better machine (wonder when gamepark will increase their sd card support) :)
If you happen to have BOB with a serial cable you could dump the debug output and we could see where it fails..

DJWillis posted on Mar 9 2007 at 08:19 PM said:
Interesting that they fail, would you be interested in testing an Open2x kernel with a combination of Notaz and my patches? My cards are also cheap'o DaneElec cards from 7DayShop.
Does the merged Open2x kernel work with your cards, which previously failed?


I would happily use Open2x myself, but I want to run what most users run just to know that my other releases work for everyone..
 
Last edited by a moderator:
DJWillis posted on Mar 9 2007 at 06:19 PM said:
Interesting that they fail, would you be interested in testing an Open2x kernel with a combination of Notaz and my patches? My cards are also cheap'o DaneElec cards from 7DayShop.

Yes, I'd be willing to test anything :)
 
Last edited by a moderator:
Just tried it, and was successful with my 4GB PEAK SDHC card.

Thanks alot for this :)

[Edit] After using it a bit, it seems to have stopped my gp2x executing autorun.gpu (both SDHC and regular sd cards). It's enabled in settings, but I may be doing something silly.. I don't know. How is it for other people?
 
Back
Top