psplink debugging/shell problems

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
JoePub
Posts: 10
Joined: Thu Aug 21, 2008 11:26 pm

psplink debugging/shell problems

Post by JoePub »

Hi Guys,

I am writing an application that is now in need of remote debugging. I have setup psplink with the M33 4.01 firmware (running with 1.50 compatibility). The application in a network based app which connects to the wifi and then sends the controller details over TCP.

I initially was using a PRX and the new API calls which are compatible with WPA access point, but since psplink requires a 1.50 firmware I have now altered the code so that it compiles a version which will be compatible on 1.50 firmware.

Now I can run the compiled 1.50 version of the application and run it from the GAME150 folder no problem. But if I try to execute or debug the application via the psplink shell, the module gets loaded but seems to hang the PSP and I have to do a hard reset (shell is still active though).

Anybody have any idea what the cause of this could be?

Module defintion below

Code: Select all

#if _PSP_FW_VERSION < 200
PSP_MODULE_INFO&#40;PSP_REMOTE, 0x1000, 0, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;
#else
PSP_MODULE_INFO&#40;PSP_REMOTE, PSP_MODULE_USER, 0, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;PSP_THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;
#endif
PSP_HEAP_SIZE_KB&#40;10240&#41;;
Makefile

Code: Select all

  INCDIR =
  TARGET = pspremote
  OBJS = pspremote.o menu.o net.o librjoy.o
  LIBS = -lstdc++

  CFLAGS = -O0 -G0 -Wall -g3
  CXXFLAGS = -fno-exceptions -fno-rtti

  BUILD_PRX = 1
  LIBDIR =
  EXTRA_TARGETS = EBOOT.PBP
  PSP_EBOOT_TITLE = PSP Remote
  
  PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
  include $&#40;PSPSDK&#41;/lib/build.mak

librjoy.o&#58; ../../pspremote_server/librjoy.cpp
	$&#40;CC&#41; $&#40;CFLAGS&#41; $&#40;CXXFLAGS&#41; -c ../../pspremote_server/librjoy.cpp




EDIT:

I seem to be able to run other applications fine from the shell, for instance the simple netsample works fine from the shell and the controller sample works from the shell
sturatt
Posts: 46
Joined: Thu Jul 13, 2006 4:21 pm

Post by sturatt »

but since psplink requires a 1.50 firmware
you could use psplinkusb which supports newer kernel stuff


I know that doesnt solve the debugging problem, but you might want to post all of the steps you are going through to start debugging as well.
JoePub
Posts: 10
Joined: Thu Aug 21, 2008 11:26 pm

Post by JoePub »

ah, interesting. Didn't know there was such a thing.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

you've got a Makefile.oe that build psplinkusb for a kernel >= 3

if you have a slim don't forget to patch from directory boot271 the makefile
replace mksfo ..... by mksfoex -d MEMSIZE=1 'PSPLink v3.0 OE' PARAM.SFO
add after BUILD_PRX = 1
PSP_LARGE_MEMORY = 1

and in main.c this PSP_HEAP_SIZE_KB(-64);

to debug i use de usb version
launch usbhostfs_pc
launch pspsh like this
in pspsh debug ./your.prx

launch psp-gdb like this
psp-gdb ./your.elf
target remote : 1001


and enjoy :p:p:p

don't forget to compile your homebrew with the -g flag
JoePub
Posts: 10
Joined: Thu Aug 21, 2008 11:26 pm

Post by JoePub »

sturatt wrote:
but since psplink requires a 1.50 firmware
you could use psplinkusb which supports newer kernel stuff


I know that doesnt solve the debugging problem, but you might want to post all of the steps you are going through to start debugging as well.
I have found the issue. I had BUILD_PRX=1 even though I was building it for a 1.50 firmware, since psplink can't load PRX files (even if wrapped inside EBOOT.PBP) i guess it was locking up before the load.

Omitting BUILD_PRX from the makefile when building for 1.50 done the trick. It now loads under psplinkusb running under 1.50 compatibility mode
JoePub
Posts: 10
Joined: Thu Aug 21, 2008 11:26 pm

Post by JoePub »

sauron_le_noir wrote:you've got a Makefile.oe that build psplinkusb for a kernel >= 3

if you have a slim don't forget to patch from directory boot271 the makefile
replace mksfo ..... by mksfoex -d MEMSIZE=1 'PSPLink v3.0 OE' PARAM.SFO
add after BUILD_PRX = 1
PSP_LARGE_MEMORY = 1

and in main.c this PSP_HEAP_SIZE_KB(-64);

to debug i use de usb version
launch usbhostfs_pc
launch pspsh like this
in pspsh debug ./your.prx

launch psp-gdb like this
psp-gdb ./your.elf
target remote : 1001


and enjoy :p:p:p

don't forget to compile your homebrew with the -g flag
Ah great, so this will allow me to debug v3/4 EBOOT/PRX's too? So the OE version is compatible with M33 also?

Can the OE version run both 1.50 EBOOT's and 3x/4x EBOOT/PRX'es, or is this a feature of the M33 GAME150 folder only when executed from the PSP menu.

Thanks for the help.

EDIT:

forgot to ask, is there a way also to get the USBHostFS_PC proggie to reconnect when the psplink resets. At the moment, when it resets, USBHostFS shoots up to 100% CPU and the pspsh is no longer responsive. Which mean I have to reset it all every time I start a debugging session.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

Forget the add after BUILD_PRX = 1
PSP_LARGE_MEMORY = 1
and in main.c this PSP_HEAP_SIZE_KB(-64);

etc il is now in the svn repository i have just test 3.x 4.x homebrew don't use 1.5 anymore
but i think it is just a guess if someone can confirm that you can both debug 1.5 and 3.x 4.x with the OE release of psplink.
For the owner of psplink a proposition: why not rename OE in OE3x4x because it is confusing if you see OE and you debug 3.x M33 and 4.x M33 homebrew see the previous questions
So Makefile.oe can become Makefile.oe3x4x
JoePub
Posts: 10
Joined: Thu Aug 21, 2008 11:26 pm

Post by JoePub »

Well thanks for your replies. I am happy with just debugging 3x/4x EBOOT's for now, which works like a charm under psplinkusb. Thanks again.
Post Reply