GP2X My Development Process


TheDoktor

Still Fresh
Joined
Nov 24, 2005
Messages
27
Age
49
Location
Liverpool, UK
Website
Visit site
Hi

At the moment my turnaround time for development is really slow. This is what I'm doing.

1. Compiling the project in Dev C++.
2. Copying the gpe to an SD card.
3. Putting the card in my GP2X.
4. Botting the exe & running the gpe

This is really a handicap as I'm hacking around with the hardware doing minor tweaks to registers and re-building.

I know I could use SDL and get the whole thing running on PC first but I'm looking at hardware stuff so this isn't an option.

Also I would really like some debug output, even a printf would be nice. I've tried writing to stdout & stderr but with no visible signs of output. I've also tried writing a text file to the SD card but with no luck.

I've tried using the USB cable but with no luck (no drives were visible).

Can anyone offer any tips?

Cheers,
Mark.
 
get thee a serial cable, and two SD cards of the same size.

use the serial cable as your debug/output/control window .. after all, .gpe's can be run at will from the shell, so just lurk at the shell to do your tests ..

with the SD cards, getting two of the same size is really only my way of saying "get two set up exactly the same: same format, and same Volume label, and be the disk-loader".

you see, i mount my SD cards on /Volumes/GP2X___ (OSX) and have an rsync script set up to automatically sync my local "dev/GP2X___" folder to the mounted SD card. when i type 'make', it all gets put in my local dir, and then sync'ed to my 'SD-based copy of the dir', which also gets synced back when i swith the SD cards.

SD-A and SD-B, both with the same volume label, just get switched around; they'll always be copies of each other .. all you do is type 'make', wait for it to complete, then switch the SD cards and run it ..

(and once you get there, extra bonus if you put serial 'expect' scripts in your Makefile that remove the need to have a hyperterminal/minicom session open ... ;)
 
TheDoktor posted on Dec 16 2005 at 09:13 AM said:
Hi

At the moment my turnaround time for development is really slow. This is what I'm doing.

1. Compiling the project in Dev C++.
2. Copying the gpe to an SD card.
3. Putting the card in my GP2X.
4. Botting the exe & running the gpe

This is really a handicap as I'm hacking around with the hardware doing minor tweaks to registers and re-building.

I know I could use SDL and get the whole thing running on PC first but I'm looking at hardware stuff so this isn't an option.

Also I would really like some debug output, even a printf would be nice. I've tried writing to stdout & stderr but with no visible signs of output. I've also tried writing a text file to the SD card but with no luck.

I've tried using the USB cable but with no luck (no drives were visible).

Can anyone offer any tips?

Cheers,
Mark.
I use to do that, but I found the SD card would take longer and longer to be recognized in the GP2X with all the swapping in and out.

To get my GP2X to be recognized as a USB mass storage device, I simply plug it into a cheap USB 1.1 hub. It now gets recognized every time. So I leave the SD card in the GP2X and have a batch file to copy the GPE and related data files from my local drives the USB drive. Then left-click on the USB icon in the system tray, select the option to remove the drive, press X on the GP2X, go to the games menu and run the game. I always make sure I have a button combination to exit the game back to the gp2x menu, then I select Settings/USB to connect the drive again.

Now my GP2X stays powered on all the time during development (unless it suffers a crash in my code) and there is zero card swapping.
 
Last edited by a moderator:
Try running /bin/sync after your program should have produced some output. If it's meant to be throwing text out to a file, you'll need to do that to get the data to sync to the card. Or if you're outputting a text file, the ebook reader will be able to see it before you shut the gp2x down.

Another answer is to get a serial cable so you can watch console output that way.
 
Would it be possible to create a kind of bootloader where you can send the file from the PC directly to the GP2x and the GP2x starts it directly (e.g. like on the Dreamcast) and falls back into the bootloader which waits for the next file to execute?
Maybe it is possible that the GP2x is recognized as a serial device for Windows XP / Linux so you needn't to have a serial cable.
 
The serial cable sounds like the best plan to me.
Does this mean I can access a command shell on the GP2X?
Also can I send new .gpe files over to it using ftp?
 
Yep, you'd get a command shell. You're probably aware already, but there is an SDL based shell out there, but it might not be any help if you're trying to debug a program that already uses SDL.

Probably can't use ftp persay, but maybe uuencoded by copy/pasting something like this to the serial port:

echo "uuencoded data line 1" > file
echo "uuencoded data line 2" >> file
echo "uuencoded data line 3" >> file
...

not sure if there's a uudecode program on the gp2x, but it would be trivial to port one.
 
Back
Top