GP2X What Is The Fastest Way To Develop And Test Apps?


azherdev

Still Fresh
Joined
May 31, 2006
Messages
15
What is the fastest process? Currently here is my way:

- Compile the program in VC++ 2005
- On GP2x, Settings -> USB -> SD
- Copy the GPE from my PC to the SD card
- On GP2x, exit USB (sometimes crashes, need reboot)
- On GP2x launch the program

Is there a faster way? I do not have the serial cable nor would I know how to make one. So debugging is also very very difficult for me. Can anyone recommend a better and faster way to develop?
 
Im guessing you are using SDL? If so, make a Win32 build of your software and test that instead of the GP2X build. It saves ALOT of time if you want to test something. I do this the majority of the time and its very useful, I probably run the Win32 build 90% of the time.
 
Quickest way to test on the gp2x is to enable networking over usb and install the samba client. That way you can telnet to the gp2x, mount a share on your pc, and run the .gpe directly from the pc's drive (and view all your printf debug information).
 
Yes, there's no need to do half of what you are doing if you have firmware v2.0.

Once you have the networking and samba client installed you can basically:

Compile program on PC
Run program on GP2X directly from your PC.

No need to even copy to your SD card :)

Of course, if your using SDL, then you can run and debug the program on your PC to make sure it works before making a GP2X version, like Guyfawkes says.
 
Hmmm, this is true even if I use the HW Accelerated SDL from Paeryn? I also am going to experiment talking directly to hardware, so I doubt the Windows compile will work well for me there.

BUT, I liket he samba idea better but I have never used linux before. I understand some portions of it but only enough to get around. Can anyone explain on how to get the samba up and running and connect to it on GP2x and Windows XP? I would appreciate that very much.

P.S. I do have Firmware 2.0.

- Alex
 
Ok, I got the samba server and networking bridged with my WinXP system. I can browse the gp2x filesystem. So how do I setup my development where I mount the PC folder/hd and able to see printf output for debugging? <_<

Thank you guys.
 
A quick lesson on how to mount a Windows share on the GP2X would be mighty handy for those of us who next to nothing about Linux, let alone Samba.

After a bit of Google research, I came across a page that tried to show how to do this.

mount -t smbfs //servername/sharename /mountdirectory -o username=mywindowsusername,password=mywindowspassword

//servername/sharename refers to the name of the Windows computer and the name of the share.

/mountdirectory refers to the directory you use as the mount point on the Linux workstation. It can be any directory as long as the user executing the command has rights to it.

Ok, so it says the mount directory can be any directory. Does it have to exist? I tried this

Code:
[root@gp2x root]$mount -t smbfs //alien/transfer /mnt/alien -o username=steve,password=
mount: Mounting //alien/transfer on /mnt/alien failed: No such file or directory

What do I put in for the mount directory? Do I have to use an existing mount point? Why does so much Linux documentation assume so much intimate knowledge?
 
i have my gp2x development environment set up like this:

1. my linux box (i'm a linux user) has the devkit onboard .. latest toolchain script built the tools, put them in the right place, no problems. this box is named spir.

2. my gp2x (named gipi) is set up with USB Networking always on, and its connected to my linux box (spir). /etc/hosts has entries for gipi: 10.0.2.2 gipi

3. when i turn on the gp2x, spir automatically detects the CDC ethernet device, and assigns it an address (10.0.2.1 ueth). spir then automatically mounts gipi to a local share, through /etc/fstab:

//gipi/gp2x /mnt/gipi auto defaults 0 0

4. all this means is that i can simply connect gipi to spir using the USB cable, and spir has full access to gipi's disk - including the /mnt/sd mount point for the SD card, which on spir looks like: /mnt/gipi/mnt/sd

5. i build my apps on spir, and my Makefile deposits the finished .gpe+libs+resources in the appropriate place on /mnt/gipi/mnt/sd ..

6. to test, i simply pick up gipi, hit 'game', hit the .gpe .. and oila: instant gratification.

7. if i need to debug something, i simply 'telnet gipi', log in, and run the .gpe manually. i haven't automated this yet in my Makefile, but its a simple thing to do .. fortunately i'm not the sort of programmer who needs a lot of debugging time and printf()'s, but its there if needed.

again, this is a very smooth setup - but it may only be so smooth (for me) because a) i'm a linux user through and through, B) i've got no problems with getting it all set up, and c) i don't use Windows, ever. however i'm sure that its possible to have a similar setup on Windows, where Windows would see the GP2X filesystem and be able to treat it like any other mounted device, and you could build straight to the right place on the GP2X' SD card .. even probably set up a smooth hosts situation so you can just treat the GP2X like any other proper host, but I dunno how to do that on Windows, some LMHOSTS crap most likely, LOL ..
 
To answer the question about mount points, yes, the directory has to exist first. If you mount something over a directory that contains stuff, you won't be able to access those contents until after you unmount it.
 
Excellent, but how, in Windows, do I get to see the output of printf() statements for debugging? Say I have the gpe on my sd card and now i picked up my gp2x and launched the program, what do i do on windows/gp2x to see those printf() statements?

thanks guys.
 
telnet to the gp2x, kill off the menu with something like 'killall gp2xmenu' (apparently this sets the clock back to 200mhz with fw2), then find your app 'cd /path/to/app', and run it with './appname.gpe'. The output will then be displayed.
 
Yup, to get the output on your pc, you need to run the app via the pc using a standard Linux console.

When you telnet to the gp2x, you'll be asked for a login - just type 'root' and you'll be given a command prompt. You can now change to the directory where you mounted your pc share (eg. cd /mnt/ext) and run your program from there. You can then see the output from your program.

If your program crashes (say with a sigsegv or similar), then type 'cat /proc/kmsg' to see why it crashed. You can also then use gdb (also in the file archive) to see exactly which source line in your program it crashed at and examine any variables/etc.
 
I created a share under windows called gp2xdev, I try to mount it and it sais "No such device.

I am using this:

mount -t smbfs //10.30.78.105/gp2xdev /mnt/dev -o username=gp2xdev password=gp2xdev

And nothing... I get "No such device". Any ideas?


Also, I do not see the printf statements. I see the SDL statements, but not my "Hello World" line... do I need to do something incode to output printf to the screen? Thanks.
 
Try

mount -t smbfs //10.30.78.105/gp2x /mnt/dev/ -o username=root -o guest

If you telnet in and run the program from there you should see the printfs
 
Parkydr, no go on both accounts.

Oh, I can see the printf statements if the program fails to launch and the "SDL Parachute" deploys ( :) ). But, if SDL successfully sets the video and launches the app, then I am out of luck, no printf statements. I have put them everywhere in the code and nothing. :(.

And for mounting it still sais no such device. It can't find my windows share. It is NTFS filesystem, perhaps that is the problem?
 
Sorry I misunderstood what you were doing, the mount command I gave was to mount the gp2x share on a Linux system.

You're trying to mount your Windows share on the GP2X? Why not mount the gp2x under Windows?

How are you running the gpe file? If you start it from the menu you wont see the printfs, you have to start it from the telnet prompt e.g. for a file x.gpe in the root directory of the SD card

cd /mnt/sd
./x.gpe

Sorry, if this is what you are doing I not trying to be patronising, I'm just trying to get my head round the problem.

Extra bit of info. I've been having a look and I don't think the GP2X has the smbfs module in the kernel
 
Parkydr:
If you mount the gp2x under Windows, it means having to copy your executable to the nand or sd card every time, wasting valuable time and erase cycles. If you mount the Windows share under the gp2x, you run the executable directly from the pc, thus it's quicker and doesn't wear out your sd/nand :)

azherdev:
have you "insmod smbfs" before using the 'mount' command?

Also, the mount command didn't seem to work for me when trying to connet anonymously, so I created an account called 'gp2x' on Windows, and logged in from the gp2x side with that username - worked fine since then. eg:

smbmount //192.168.1.210/gp2xshare /mnt/ext/pc -o username=gp2x,password=gp2x

You'll get some errors about not being able to find some stuff, but it'll still work anyway, so make sure you try 'df' afterwards to see if it's actually done it or not:

[root@??host?? root]$df /mnt/ext/pc
Filesystem 1k-blocks Used Available Use% Mounted on
//192.168.1.210/gp2xshare 134205440 66902016 67303424 50% /mnt/ext/pc
[root@??host?? root]$
 
I'd tried insmod smbfs and got

insmod: smbfs.o: no module by that name found

I haven't got smbmount on my GP2X either


EDIT: I needed this didin't I :huh:
 
What is the fastest process? Currently here is my way:

- Compile the program in VC++ 2005
- On GP2x, Settings -> USB -> SD
- Copy the GPE from my PC to the SD card
- On GP2x, exit USB (sometimes crashes, need reboot)
- On GP2x launch the program

Is there a faster way? I do not have the serial cable nor would I know how to make one. So debugging is also very very difficult for me. Can anyone recommend a better and faster way to develop?

Just my pennies worth.

I dev in 2005 like your self, I have a bat file on the post build events. It copys over the files needed, bin file for 940 and the exe and any data thats changed in the data dir. I've had to put some if's in the batch file to stop it running if the build failed. This is done by the projects deleting thier target before the build starts. Then I can do a command like the following IF NOT EXIST ..\..\k9\gpu\lib\%2\gpu.bin goto :EOF in the batch file.
I have all the networking enabled on my GP2x and I just telnet into it. Kill the menu (this bit only needs to be done once, or when I kill it and reboot ;) ) Then just ./myapp.gpe Its not perfect buts its quickish. This share of a windows dir for the gp2x to read from sounds good but i'm no network wiz.
 
Last edited by a moderator:
Back
Top