GP2X Methods Of Dev


fdave

Final Dave
Joined
Apr 20, 2004
Messages
331
Website
www.finalburn.com
Hey guys!

When you develop, do you compile and use an emulator and then transfer using a card reader (someone suggested using a card reader is the best way to transfer stuff)?

Or do you have the USB cable plugged in? I just get USB Device error at the moment, but I'm wondering what everyone else does? Reesy, how do you dev usually?

Dave
 
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.
 
I mount a directory from the PC over Samba on the GP2X and run directly from that.
 
I build all my programs so they run on the PC. Once they run there, and I've checked them with valgrind for memory leaks I compile them for the GP2x and I then mount my development directory and run directly from their.

I've abstracted all the platform specific out from code so the code that I have to test now is entirely platform independent. The only problem is that inefficient algorithms are much more noticeable on the GP2x than they are on my AMD64 3200+...

Andrew
 
Epicenter posted on Aug 24 2006 at 03:16 PM said:
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.

:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!
 
Last edited by a moderator:
I do the same as orkie, using telnet to control the gp2x and a directory in my pc mounted in the gp2x filesystem using samba.
The thing is that i mount the directory as /mnt/sd, to be as close as i can to the final user "experience"
 
fdave posted on Aug 24 2006 at 09:38 AM said:
Epicenter posted on Aug 24 2006 at 03:16 PM said:
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.

:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!

It's quite easy; just grab the RNDIS drivers off the archive and install them after plugging in the GP2X to the PC and enabling 'USB Network', and Samba in the System menu. Then find the newly-made network interface in "network connections" and set its IP to 192.168.0.1, and then the GP2X's IP in the system menu to something else in that range, I use 9 arbitrarily. This is assuming you use Windows XP, though.
 
Last edited by a moderator:
fdave posted on Aug 24 2006 at 03:38 PM said:
:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!

Time to plug my blog - click here and checkout my latest post.

Hope it is useful.

Andrew
 
Last edited by a moderator:
fdave posted on Aug 24 2006 at 03:38 PM said:
Epicenter posted on Aug 24 2006 at 03:16 PM said:
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.

:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!
I have not seen you for ages! Didn't you do Gigadrive?
 
Last edited by a moderator:
The file transfer speed across the USB link is pretty poor. I currently build on a linux server, then drag between Samba shares on my Windows laptop. If I ever do anything with more than one file I have a mental note to use rsync, to avoid copying more data than necessary.
 
sam fisher posted on Aug 24 2006 at 05:16 PM said:
fdave posted on Aug 24 2006 at 03:38 PM said:
Epicenter posted on Aug 24 2006 at 03:16 PM said:
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.

:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!
I have not seen you for ages! Didn't you do Gigadrive?

Yep that's me. Thanks for all the help! Hopefully i'll do some cool coding this sunday...
 
Last edited by a moderator:
I connect the GP2X via USB, use telnet to connect to it and run stuff from the console. It's good because I am learning about Linux that way =D Like chmod, ps, kill etc.

When I compile I have my game project setup to cross compile to Windows as well as the GP2X, so I can test non GP2X specific code easily, and when I want to test on the device I open up an FTP connection to the GP2X, transfer the file, use chmod to set executable permissions and launch from telnet, looking at debug messages etc.

FTP is a little slow for me, but that's because I am using a USB 1.1 port instead of one of my USB 2.0 ports.

I did have a bad experience using FTP though, it seemed to screw my 1Gb SD card up. Call it coincidence, but I reckon the GP2X somehow corrupted the secure area of the SD card, effectively killing it. I am now a little concerned about FTP and watch it carefully :ph34r:

andrew_j_w posted on Aug 24 2006 at 03:30 PM said:
I build all my programs so they run on the PC. Once they run there, and I've checked them with valgrind for memory leaks I compile them for the GP2x and I then mount my development directory and run directly from their.

I've abstracted all the platform specific out from code so the code that I have to test now is entirely platform independent. The only problem is that inefficient algorithms are much more noticeable on the GP2x than they are on my AMD64 3200+...

Andrew

valgrind?? What's this? I really could use this right now... I suspect I have a very small memory leak, but can I find the bugger...
 
Last edited by a moderator:
Gadget posted on Aug 24 2006 at 06:53 PM said:
valgrind?? What's this? I really could use this right now... I suspect I have a very small memory leak, but can I find the bugger...

From Wikipedia - Valgrind is a free programming tool for memory debugging, memory leak detection, and profiling.. You can find it here. It's Linux only, but it is a really amazing tool.

Andrew
 
Last edited by a moderator:
fdave posted on Aug 24 2006 at 06:06 PM said:
sam fisher posted on Aug 24 2006 at 05:16 PM said:
fdave posted on Aug 24 2006 at 03:38 PM said:
Epicenter posted on Aug 24 2006 at 03:16 PM said:
I use a USB cable with USB networking; I set the GP2X as 192.168.0.9, my PC as 192.168.0.1, open the Samba share on the '2x and copy my files over that way. Then I run them from a telnet session to view debug info, etc.

:blink: wow that sounds awesome! how do i get set up to do that then? I've just got my GP2X, haven't unwrapped the install disks yet

can you point me at a good FAQ to get set up with Samba shares?!
I have not seen you for ages! Didn't you do Gigadrive?

Yep that's me. Thanks for all the help! Hopefully i'll do some cool coding this sunday...

He's also the genious behind the cyclone cpu core, without which all DrMD would be as slow as...something slow....ahh I'm tired, you get the general idea.

craigix posted on Aug 24 2006 at 06:57 PM said:
I'm just old school and use a card reader :)

Yep me too. Just compile, copy to SD card via card reader and then run on the GP2X. I may have to look into the USB network thingy, that sound interesting, could save my SD card from all the wear and tear.
 
Last edited by a moderator:
Erm, perhaps I'm missing something here - I'm running firmware 2.0.0, and when I plug in my USB cable, turn the GP2X on and go to USB in Settings, all I get is a choice between whether to expose the NAND or SD memory... no USB networking options to be seen at all?
 
Parkydr posted on Aug 24 2006 at 09:27 PM said:
Set "Menu Extension" to "ON" to get the other options

Ah-ha! Cheers for that. I should have done my homework and read this... At least now I can also prevent SD card wear-out :p

For any other (non-linux) newbs reading who would like to mount a folder (as shared on your PC) onto your GP2X (via Samba on the GP2X), you can do the following. I assume here that you've already read Andrew's blog and can get a terminal session open to your GP2X:
  • Get the ARM Samba client from here
  • Start up the Samba server on the GP2X
  • Browse to \\gp2x in Windows Explorer or similar
  • Copy the contents of the above zip file to the root of your GP2X, overwriting if Windows asks you to
  • Once logged in to your GP2X via telnet, type "insmod smbfs" at the shell to install the samba filesystem module
  • You're then free to mount any shares you may have on your host PC - simply type something like "smbmount //192.168.1.1/gp2x /mnt/sd/" at the shell, depending on your networking/share setup.
Also, for proper game testing while telnet'd in, be sure to "killall gp2xmenu" at the shell, or else when you start a program via telnet the menu will still have input focus, as well as try attempt to compete for the screen.

To start a program from the telnet shell simply type something similar to the following on the command line:

Code:
cd /mnt/sd/myprogramdir/
./myprogram.gpe

You should see any text sent to standard out/standard error on the terminal - the program should start as normal on your GP2X, with all the usual graphical output going to the GP2X's screen. If you want to terminate the application without quiting properly (e.g. the program has hung or something) you can try hitting Ctrl+C in the terminal. If that fails, you might need to start another command window, telnet into your GP2X again, and then type

Code:
killall myprogram.gpe

If that did nothing and the first terminal has still not dropped back out to the the command prompt, you might need to do the more drastic:

Code:
killall -9 myprogram.gpe

More info on the Samba stuff available, as always, on the wiki.

HTH!
 
Last edited by a moderator:
Back
Top