ps2link printf question

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
kegel
Posts: 3
Joined: Tue Sep 27, 2005 9:56 pm
Location: Hamburg

ps2link printf question

Post by kegel »

Hello,

I am having some trouble using printf for debugging in InLink. I'm not sure if this is normal or if I'm doing anything wrong...
I have this piece of code from the Hello World example:

Code: Select all

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>

int main&#40;&#41;
&#123;   
   SifInitRpc&#40;0&#41;; 

   printf&#40;"Hello, world!\n"&#41;;
   nprintf&#40;"Hello, again, from Naplink RPC!\n"&#41;;
   return 0;
&#125;

I can compile it and run the elf file through InLink without any problems. Now whenever I add another printf("something"); recompile the elf and try to execute it through InLink, I get this message and have to manually reset the PS2 :

Code: Select all

Get Reboot Request From EE
ps2ip_ShutDown&#58; Shutting down ps2ip-module
When I execute the same file after the reboot, it works fine until i make new changes. This only happens when I make calls to printf/nprintf from my code. Is there something obvious I'm missing?

I'm using PSLink v1.2.4 and InLink v1.3.7.

Thanks,
kegel
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

Add SleepThread(); before returning 0. So ps2link gets control back after your program has finished.
Also, it's better to reset ps2link everytime before executing code.
Post Reply