Page 1 of 1

Debugging IOP Modules

Posted: Wed Jun 20, 2007 1:09 pm
by ubergeek42
Is there any recommended ways for debugging IOP modules, when an IOP reset is used? Is there any way to redirect printf's from IOP modules to be sent over an ee_sio cable?

Posted: Wed Jun 20, 2007 3:28 pm
by radad
I believe the ps2sdk/iop/deug/sior module is for the sio cable. There is an sio_printf function in there. I havent used it myself so I am not sure.

Posted: Wed Jun 20, 2007 10:23 pm
by ubergeek42
Thanks for the lead, but I can't load the module:

Code: Select all

Binding RPC.
Huh, not available, retrying... ?
Binding RPC.
Huh, not available, retrying... ?
Giving up.
I don't know what this means, so any help would be appreciated.

Posted: Wed Jun 20, 2007 11:45 pm
by Lukasz
The IRX is trying to bind with a Remote Procedure Call (RPC) Server on the EE side. You need to link with libsior.a on EE side and call SIOR_Init to create the RPC server, preferably before you load the module.

Posted: Thu Jun 21, 2007 5:01 am
by ubergeek42
Thanks, I figured there had to be something on the ee side, I just didn't have any idea what. (And documentation is kinda lacking in the sdk)

printf seems broken in the sior irx module
It crashes the console, after printing one character(Granted I had need need to be using printf, it was just a constant string)
Using puts works fine, and I can always combine with sprintf to achieve the desired result.

Again, thanks for the help guys.

Posted: Thu Jun 21, 2007 5:41 am
by Lukasz
ubergeek42 wrote: printf seems broken in the sior irx module
It crashes the console, after printing one character(Granted I had need need to be using printf, it was just a constant string)
Using puts works fine, and I can always combine with sprintf to achieve the desired result.
This could possibly be related to the fact the sprintf appears to be broken on the IOP, check this thread:

http://forums.ps2dev.org/viewtopic.php?t=8326

I'd recommend adding your own sprintf, possibly porting the EE one from ps2sdk.

Posted: Thu Jun 21, 2007 6:29 am
by ubergeek42
Hmm, I was just coming over to the forums to search for that, I vaguely remembered reading that topic(but at the time was uninterested in the iop)

Thanks for the tip on how to do it as well.

Edit: wow the ee version of printf is crazy, I found a simpler implementation(which does what I need it to do, basic debug) written for embedded systems, and it seems to work well.

http://www.menie.org/georges/embedded/