HOWTO: Unbrick 'most' bricked GP2X's
Update: 7th August 2006
I got my Wiggler JTAG setup fixed and now have a working GP2X again (thanks to Jr2Swiss for the salvaged GP2X bits :)).
As I now have everything up and working again I am more then happy to offer to try and unbrick peoples GP2X's if you get stuck yourself.
I am working on a cross-platform JTAG guide to go with this (and trying to make FW 2.0 files for this guide) so expect that in a few days.
Update: 23rd July 2006
I just thought I would quickly put this note at the beginning of the guide to let people know why I have been slow replying to mails and comments about bricked GP2X's (and in some cases, not replying at all I am sorry to say). I have read all the mails and thanks for all the feedback.
Some time ago my GP2X died (not bricked, board fault) about 2 weeks after I broke my jTAG setup. This combined with no small about of personal shenanigans :( has had several effects on my GP2X stuff, it has meant that I am not able to offer to unbrick peoples GP2X's with broken bootloaders at the moment (I do apologise) and secondly as I don't have a working GP2X doing the long overdue update of this guide to firmware 2.0 has been somewhat on hold, oh and of course as some people have noticed my other projects (i.e. ScummVM) have slowed up somewhat.
All being well I will have enough saved up next month to get another GP2X and grab a BoB at the same time and I plan on updating all this guide for the latest firmware (and adding a detailed jTAG guide) as soon as I get a new unit (I have worked most of it out, just need to test it all).
At that point I will be happy to offer to unbrick GP2X's again the same way I used to (for postage and a small donation to the charity of your choice).
Regards John
---------
Original Guide
---------
If you wish to mirror this article please let me know and leave credits.
If this guide looks a little scary contact me, I am happy to unbrick peoples GP2Xs (for now).
---------
Strong Warning: (In case you don’t want to read the whole article)
Do not EVER try and flash your unit with batteries (Even with GPH updates).
I have had several reports of people making things worse as there batteries gave out half way through a flash. A full flash of the file system (gp2x_file.img) can completely drain a set of good high capacity batteries before the flash completes and just the kernel update can drain an average set.
---------
Has your shiny GP2X been subject to some abuse that it was not to happy about?
Have you been messing about with the NAND, shared libraries or some other dark area and watched it all go wrong?
Well if you have and your unit now refuses to reboot into the launcher then this guide may help you out.
All the files used in this guide are based around the GPH 1.0.1 firmware with all the updates as of 29th November 2005 applied, tested and working as well as they normally do. (I.e. eBook reader, mplayer, Music player etc.)
You probably want to keep the kernel and ROOT file system in sync with each other so future updates get applied in a consistent manor. (I.e. if you are using a firmware newer or older then 1.01 then reflash both the kernel and ROOT file system then upgrade again using GPH updates).
Before we start: Warnings!
Put a good hour aside to do this, leaving things half done is not really very clever.
You WILL need a good working SD card that the GP2X can see. FAT32 formatting on the card seems most reliable in tests.
Note: I used a 256MB SanDisk regular SD card without issues throughout. My 1GB Viking SD card also worked. MMC cards are a no-go for this task. Slower SD cards seem on the whole more reliable for this task.
You WILL need a PSU capable of running the GP2X, using batteries when flashing something as delicate as your whole NAND is a VERY bad idea. The flashing really eats batteries and they could well go flat long before a flash is done.
A serial adaptor for the GP2X is very desirable so you can monitor progress of the reflash – I would almost say essential unless you are particularly frivolous.
Note: If you have one, plug it in now and connect to your GP2X via whatever serial port you have it connected to. I use 115200, 8, n, 1, XON XOFF to connect. You will see output to your serial console as soon as your turn the unit on. If you have no serial port on your PC anymore get a cheap USB<>Serial adaptor and use that with the serial lead.
Note: http://www.toyz4boyz.co.uk/ will be selling the serial leads for the GP2X very soon if you need one, see http://www.toyz4boyz.co.uk/gp2x/hardware/serial/. Toyz4Boyz are great for GP32 bits and bobs and I know they have some cool GP2X stuff planned ;-).
Firstly: Identity how seriously your GP2X is bricked
No: Carry on ;-).
No: Drop me an e-mail or pop into #GP2XDEV on EfNet IRC and I see if I can help you further.
No: It looks like something may have damaged your kernel image. Try flashing this 1st (See: Reflashing the kernel) and then only flash the ROOT file system if needed.
The art of reflashing.
The GP2X’s automated SD based reflashing from the boot loader consists of 3 files that contain 3 distinct parts of the system. The combinations of these on the SD effect what happens when U-Boot tries to kick off the flash.
These are… (Linked to zipped downloads)
Reflashing the file system.
99% of brickings seem to be caused by the root file system becoming corrupt. It is hard to tell exactly what went wrong without the benefit of serial console output.
Anyway, onto restoring the file system.
“FILE UPDATE ----------------------------
reading gp2xfile.img
READ START 25165824”
Note: If you see “SD Initialize fail..” then go and start again with another SD card, U-Boot does not like your current one. You did put the SD in the GP2X didn’t you not an MMC card.
The unit may then seem to stop for a few secs then showing something similar to that below.
“Why block_cnt == 0??
Why block_cnt == 0??
25165824 bytes read
3 : g_filesize 1800000
gp2xfile.img Update 25165824 0x1804000”
“NAND write: device 0 offset 0x240000, size 0x1804000”
This is good, it tells us that the image is valid and being written to the NAND.
“nand_write_page: Failed write, page 0x000043b4, 6275072 bytes written: ERROR
NAND write: device 0 offset 0x240000, size 0x1804000 ... nand_write_page: Failed write, page 0x00006e53, 11550720 bytes written: ERROR
NAND write: device 0 offset 0x240000, size 0x1804000 ... nand_write_page: Failed write, page 0x00006fb6, 11730944 bytes written: ERROR”
These can be safely ignored. This is normal on the GP2X and it should all reflash successfully given time.
Please test it and report back.
To view a complete serial log from a successful reflash of the ROOT file system click here.
If you get a SEGFAULT in GP2XMENU when you reboot the GP2X try flashing again.
I had this happen once and I can only put it down to a bad flash.
If you still have problems continue to “Reflashing the kernel”.
Reflashing the kernel.
Reflashing the kernel is actually a fairly simple affair. If you follow the above guide for the file system but substitute gp2xfile.img (and zip) for gp2xkernel.img (and zip) you won’t go far wrong.
The kernel takes almost no time to flash, a few minutes in the worst case. Unlike the file system reflashing the gp2xkernel.img file is also deleted from the SD card as soon as Linux boots to prevent the unit being reflashed on the next reboot.
Reflashing the boot loader.
I am sure you can work out how to do it but my advice is don’t unless you know what you’re doing and have a good reason to do so. You can really badly brick your GP2X with this.
That’s all for now, please leave comments and updates.
John Willis
I got my Wiggler JTAG setup fixed and now have a working GP2X again (thanks to Jr2Swiss for the salvaged GP2X bits :)).
As I now have everything up and working again I am more then happy to offer to try and unbrick peoples GP2X's if you get stuck yourself.
I am working on a cross-platform JTAG guide to go with this (and trying to make FW 2.0 files for this guide) so expect that in a few days.
Update: 23rd July 2006
I just thought I would quickly put this note at the beginning of the guide to let people know why I have been slow replying to mails and comments about bricked GP2X's (and in some cases, not replying at all I am sorry to say). I have read all the mails and thanks for all the feedback.
Some time ago my GP2X died (not bricked, board fault) about 2 weeks after I broke my jTAG setup. This combined with no small about of personal shenanigans :( has had several effects on my GP2X stuff, it has meant that I am not able to offer to unbrick peoples GP2X's with broken bootloaders at the moment (I do apologise) and secondly as I don't have a working GP2X doing the long overdue update of this guide to firmware 2.0 has been somewhat on hold, oh and of course as some people have noticed my other projects (i.e. ScummVM) have slowed up somewhat.
All being well I will have enough saved up next month to get another GP2X and grab a BoB at the same time and I plan on updating all this guide for the latest firmware (and adding a detailed jTAG guide) as soon as I get a new unit (I have worked most of it out, just need to test it all).
At that point I will be happy to offer to unbrick GP2X's again the same way I used to (for postage and a small donation to the charity of your choice).
Regards John
---------
Original Guide
---------
If you wish to mirror this article please let me know and leave credits.
If this guide looks a little scary contact me, I am happy to unbrick peoples GP2Xs (for now).
---------
Strong Warning: (In case you don’t want to read the whole article)
Do not EVER try and flash your unit with batteries (Even with GPH updates).
I have had several reports of people making things worse as there batteries gave out half way through a flash. A full flash of the file system (gp2x_file.img) can completely drain a set of good high capacity batteries before the flash completes and just the kernel update can drain an average set.
---------
Has your shiny GP2X been subject to some abuse that it was not to happy about?
Have you been messing about with the NAND, shared libraries or some other dark area and watched it all go wrong?
Well if you have and your unit now refuses to reboot into the launcher then this guide may help you out.
All the files used in this guide are based around the GPH 1.0.1 firmware with all the updates as of 29th November 2005 applied, tested and working as well as they normally do. (I.e. eBook reader, mplayer, Music player etc.)
You probably want to keep the kernel and ROOT file system in sync with each other so future updates get applied in a consistent manor. (I.e. if you are using a firmware newer or older then 1.01 then reflash both the kernel and ROOT file system then upgrade again using GPH updates).
Before we start: Warnings!
Put a good hour aside to do this, leaving things half done is not really very clever.
You WILL need a good working SD card that the GP2X can see. FAT32 formatting on the card seems most reliable in tests.
Note: I used a 256MB SanDisk regular SD card without issues throughout. My 1GB Viking SD card also worked. MMC cards are a no-go for this task. Slower SD cards seem on the whole more reliable for this task.
You WILL need a PSU capable of running the GP2X, using batteries when flashing something as delicate as your whole NAND is a VERY bad idea. The flashing really eats batteries and they could well go flat long before a flash is done.
A serial adaptor for the GP2X is very desirable so you can monitor progress of the reflash – I would almost say essential unless you are particularly frivolous.
Note: If you have one, plug it in now and connect to your GP2X via whatever serial port you have it connected to. I use 115200, 8, n, 1, XON XOFF to connect. You will see output to your serial console as soon as your turn the unit on. If you have no serial port on your PC anymore get a cheap USB<>Serial adaptor and use that with the serial lead.
Note: http://www.toyz4boyz.co.uk/ will be selling the serial leads for the GP2X very soon if you need one, see http://www.toyz4boyz.co.uk/gp2x/hardware/serial/. Toyz4Boyz are great for GP32 bits and bobs and I know they have some cool GP2X stuff planned ;-).
Firstly: Identity how seriously your GP2X is bricked
- Does the unit boot into the GPH launcher and play movies, games, music etc.?
No: Carry on ;-).
- Turn the unit off. Remove any batteries.
- Turn on the unit running it from a suitable PSU.
- Do you get a black screen with a GP2X logo in the middle of it?
No: Drop me an e-mail or pop into #GP2XDEV on EfNet IRC and I see if I can help you further.
- Do you get a ‘loading’ screen? These are green with a GP2X logo on them and hang around while Linux is being booted?
No: It looks like something may have damaged your kernel image. Try flashing this 1st (See: Reflashing the kernel) and then only flash the ROOT file system if needed.
The art of reflashing.
The GP2X’s automated SD based reflashing from the boot loader consists of 3 files that contain 3 distinct parts of the system. The combinations of these on the SD effect what happens when U-Boot tries to kick off the flash.
These are… (Linked to zipped downloads)
- gp2xboot.img – U-Boot boot loader image
- gp2xkernel.img – The Linux kernel image
- gp2xfile.img – The JFFS2 ROOT file system.
- 101files.zip – The updates to the file system from the 1.0.1 upgrade.
Reflashing the file system.
99% of brickings seem to be caused by the root file system becoming corrupt. It is hard to tell exactly what went wrong without the benefit of serial console output.
Anyway, onto restoring the file system.
- Get yourself a copy of gp2xfile.img and extract the zip to the root of an empty freshly formatted, working, SD card. Check the MD5 hash if you want to be sure the image is valid.
- Make sure your PSU and serial leads are connected and working well.
- Turn off the GP2X if it was on and put the SD card into the GP2X.
- Turn on the GP2X and if all is well you should see output like the following on the serial port after the U-Boot initialisation strings.
“FILE UPDATE ----------------------------
reading gp2xfile.img
READ START 25165824”
Note: If you see “SD Initialize fail..” then go and start again with another SD card, U-Boot does not like your current one. You did put the SD in the GP2X didn’t you not an MMC card.
The unit may then seem to stop for a few secs then showing something similar to that below.
“Why block_cnt == 0??
Why block_cnt == 0??
25165824 bytes read
3 : g_filesize 1800000
gp2xfile.img Update 25165824 0x1804000”
- The LCD on your GP2X should now show a graphic showing a chip and indicating that the firmware is being upgraded. You are now 100% committed to seeing this to its conclusion.
- The next thing you will see on the serial console is…
“NAND write: device 0 offset 0x240000, size 0x1804000”
This is good, it tells us that the image is valid and being written to the NAND.
- Next, things get interesting. The GPH flash code is setup to keep retrying the flash until it completes successfully. This is a good thing as you are going to get lots of errors written to the serial port like these below.
“nand_write_page: Failed write, page 0x000043b4, 6275072 bytes written: ERROR
NAND write: device 0 offset 0x240000, size 0x1804000 ... nand_write_page: Failed write, page 0x00006e53, 11550720 bytes written: ERROR
NAND write: device 0 offset 0x240000, size 0x1804000 ... nand_write_page: Failed write, page 0x00006fb6, 11730944 bytes written: ERROR”
These can be safely ignored. This is normal on the GP2X and it should all reflash successfully given time.
- Go and get a coffee and settle down to watch the screen. This could take up to an hour depending on the retry rate.
- Once the flash completes successfully you will see something similar to
- The unit will now reboot and if all is well load Linux and then load the launcher and your back up and running.
- There is one step you really must do now unless you want to keep reflashing your GP2X and that is REMOVE the gp2xfile.img from your SD card and do not reboot the unit with it on your SD in it unless you want to reflash again.
- Lastly, if you are back into the GPH launcher get your SD card and extract the contents of 101files.zip to the root of the SD card and run '101patch.gpu' from the Utilites menu in the GPH launcher to restore the ability to play Music and Videos.
Please test it and report back.
To view a complete serial log from a successful reflash of the ROOT file system click here.
If you get a SEGFAULT in GP2XMENU when you reboot the GP2X try flashing again.
I had this happen once and I can only put it down to a bad flash.
If you still have problems continue to “Reflashing the kernel”.
Reflashing the kernel.
Reflashing the kernel is actually a fairly simple affair. If you follow the above guide for the file system but substitute gp2xfile.img (and zip) for gp2xkernel.img (and zip) you won’t go far wrong.
The kernel takes almost no time to flash, a few minutes in the worst case. Unlike the file system reflashing the gp2xkernel.img file is also deleted from the SD card as soon as Linux boots to prevent the unit being reflashed on the next reboot.
Reflashing the boot loader.
I am sure you can work out how to do it but my advice is don’t unless you know what you’re doing and have a good reason to do so. You can really badly brick your GP2X with this.
That’s all for now, please leave comments and updates.
John Willis