![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Beginner's Guide to Debugging with PSPLink within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; There comes a time when printf statements just aren't enough. When you get hopelessly stuck on a coding problem and ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() ![]() Developer
|
There comes a time when printf statements just aren't enough. When you get hopelessly stuck on a coding problem and just can't understand why your code isn't behaving as you expect, it's time to start using some more advanced tools. This document will attempt to help get you started with PSPLink debugging with a minimum of pain. Although PSPLink comes with an excellent manual, it can be intimidating to beginning and intermediate coders. This first post will be updated in the future to keep it current and add tips and tricks.
Note: PSPLink is intended for C/C++ programs. It is also limited to 1.0 and 1.5 firmwares because it requires kernel mode access. This document assumes you're using Cygwin and Windows and that you will use USB to control PSPLink. Installing PSPLink
You now have the ability to control your PSP from your PC and run PSP programs from your PC hard drive. But first we need to run the PC cmmunications server and then login to the PSP. In your Cygwin home directory run the usbhostfs_pc.exe program. If PSPLink is running it will now tell you it is "Connected to device". Open another Cygwin shell and run telnet: Code:
telnet localhost 10000 Now let's try running PSP homebrew from the memory stick: Code:
cd ms0:/psp/game ls So how do we get started doing something useful to make coding quicker/easier? The first step is reassigning the host0: drive. Switch back to the usbhostfs_pc wnidow and type "drives". You'll see that you have 8 devices to work with, but since PSPLink will always come back to host0:, it makes sense to temporarily assign it to your development directory to speed up development. For illustration I'll use the Cygwin username "john" and he's working on a simple test program called "test" in the "test" directory. In the usbhostfs_pc window type "mount 0 /home/john/test". Now type "drives" again and you'll see that you have reassigned host0:. In the telnet window type "cd host0:" and "ls" and verify that you're in the right place. Now for some rapid development. Open a third Cygwin window and change to your test directory. You have a working demo but you want to tweak it. So build it now with the make command. When the make is finished, switch to the telnet window and type "./test.elf" to run the elf executable version of your program. It will then run on the PSP and you can see what it looks like. Exit the program and your PSP resets, but since you assigned host0: you'll still be in your test directory. So make atweak, run make again, and repeat as neccessary until it works the way you like. Isn't this faster and easier than copying your kxploit directories to the PSP every time you make a change? Now that you have the PSPLink environment set up and working, it would be a good time to look at the PSPLink manual in the psplink directory (psplink_manual.pdf). PSPLink can do much more than what has been covered so far. Even if you understand very little of the manual you may see some useful commands you'd like to try. So are we debugging yet? Not really. The next installment will continue in this first post with instructions on installing and using the psp-gdb debugger. |
|
|
|
|
|
#2 |
![]() ![]() ...in a dream...
|
Hey nice tutorial, but how can i do this via wifi???
Cause my USB cord is F'd up and i use FTP to transfer files and such so this could be very useful for me... especially wireless so my friend can test and tell me whats going on while i do the stuff on the comp...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#4 |
![]() ![]() ...in a dream...
|
Same here... but once I saw Wifi ability, Ill give it a twirl... But I need to install the toolchain again first... Right now its being very un-likeable =(
P.S. Why hasnt anyone posted in here before? I just found this via a link at psp-programming.com, but man, im suprised not one person posted in here before...
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Thanks, this will help some out.
|
|
|
|
#6 |
![]() |
Uh, when running the exe, I get a cannot locate cygwin1.dll error.
Edit: Ok, some fixes in the tut need to be done: Code:
./toolchain -p Code:
./toolchain.sh -p Edit2: all eboots I try ton run from Hdd give me an error: Failed to Load/Start module 'Directory to eboot/eboot.pbp' Error: 0x80020001 Edit3: Those errors were my problem, think nothing of Edit2. Also, you do want usbhostfs_pc.exe in the C:\cygwin folder, but also get a copy of cygwin1.dll out of the C:\cygwin\bin folder and put it in the same directory as usbhostfs_pc.exe. Last edited by DiabloTerrorGF; 05-25-2006 at 10:19 AM.. |
|
|
|
|
|
#8 |
![]() ![]() Developer
|
Thanks for the detailed info, DiabloTerrorGF. I'm going to start a new Windows/Cygwin/SDK/etc installation from scratch soon and try to come up with a few improvements. I seem to remember seeing the cygwin1.dll problem but correcting it by reinstalling Cygwin. Or I might have put it in windows\system and forgotten about it.
I wrote this guide because after waiting too long to try PSPLink and then getting frustrated with setting it up it's been such a great tool I can't image not using it. Since there's some interest I'll make some corrections and work on the debugging guide when I have more time. |
|
|
|
|
|
#9 |
|
Few things you might want to note, first psplink now saves your current directory between reboots so you no longer have to worry as much about mapping your directory to host0: although that isn't necessarily a stupid thing to do.
And why do you not use pcterm ? pcterm gives you a nicer shell imo, command line history and editing, logging of output and other lazy things
|
|
|
|
|
|
|
#11 |
|
could someone help me here. i cant seem to get this to work. when i try and load up the bash shell, and the usbhostfs program, it wont work. it just wont open the usb program. and if i have the usb program open, and load a bash shell, that wont work. whats wrong here
Double Post Merge any help please people |
|
|
|
|
|
|
#12 |
|
I made a cable for a gps-360 receiver to interface with my psp serial port, with the hopes of testing it with the 'gps-viewer' software (by 'deniska'), but the software is configured for NMEA sentences at 38400bps. I need to change this to 4800bps. The sourcefile contains a section that sets the bitrate, but I unfortunately have no clue as how to alter it, compile it into a file that I can run. I am in the process of educating myself on how to do this, but theres an overwhelming amount of information to absorb.
Right now I just want to test my cable out, so I can put away the soldering iron! The easiest way seems to be to modify the software. Can someone with a compiler do this for me? |
|
|
|
|
![]() |
| Tags |
| beginner , debugging , guide , psplink |
| Thread Tools | |
|
|