troubles referencing sceHprmEnd

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

Moderators: cheriff, TyRaNiD

Post Reply
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

troubles referencing sceHprmEnd

Post by rus_pa »

I noticed I cannot compile any of the sio prx example sources I could find here or in the sdk examples, always my compiler blows as soon as I insert a specific "sioDebugxxx" command, I'm a bit worried for that because other prx code works and runs...

Code: Select all

#include <pspsdk.h>
#include <pspkernel.h>
#include <pspdisplay_kernel.h> 
#include <stdio.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <string.h>

PSP_MODULE_INFO&#40;"myLib", 0x1006, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

u32 k1;


int main&#40;int argc, char **argv&#41;
&#123;
	printf&#40;"blah blah..."&#41;;
	return 0;
&#125;


//////////////////////////////////////////////////////////////////////////
int module_start&#40;SceSize args, void *argp&#41;
&#123;
     return 0;
&#125;
//////////////////////////////////////////////////////////////////////////
int module_stop&#40;&#41;
&#123;
   return 0;
&#125; 
//////////////////////////////////////////////////////////////////////////
int sioGetInt&#40;&#41;&#123;
    
 return 0;
&#125;

void sioInit&#40;void&#41;
&#123;
      pspDebugSioInit&#40;&#41;;
    

&#125; 

C:/pspdev/psp/sdk/lib/libpspdebug.a(sio.o): In function `pspDebugSioInit':
/tmp/pspdev/pspsdk/src/debug/sio.c:122: undefined reference to `sceHprmEnd'
collect2: ld returned 1 exit status
make: *** [mylib.elf] Error 1

this happens everytime I insert some specific sio funcions.. How can get it past? I run a 371 fat psp, but the problem is still at compile time, by now.


I also find that someone initializes the sio in their prx by a uncommon code like this:

Code: Select all

        
sceHprmEnd&#40;&#41;;                    // I cannot compile this line
sceSysregUartIoEnable&#40;4&#41;;
sceSysconCtrlHRPower&#40;1&#41;;
but I can't get past the sceHprmEnd() line, if I comment it out the compiler works, but anyway blows again as I insert a pspDebugGetChar to read something from the serial port.

[/code]
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Well, posting the makefile is what usually help in these cases. (make sure to dd -lpsphprdm_driver to the libs)
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

Code: Select all

TARGET = sioprx
#OBJS = sceDisplay_driver.o main.o
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

BUILD_PRX = 1
PRX_EXPORTS = exports.exp

USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1

LIBDIR =
LDFLAGS = -mno-crt0 -nostartfiles
LIBS =

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak


all&#58;
	psp-build-exports -s exports.exp

this is my makefile, and there's not the extra parameter you mentioned...
I'll give a try now
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

ok it compiles, also with other pspDebugxxx instructions now, but psp crashes on serial initialization. I wonder wether I got to include some raw code from sio.c or something.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Well, sceSysregUartIoEnable(4) and sceSysconCtrlHRPower(1) which are called by either that code you posted or internally by pspDebugSioInit have different nids in 3.71, and 3.71 M33 didn't have any nids resolver.
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

moonlight wrote:Well, sceSysregUartIoEnable(4) and sceSysconCtrlHRPower(1) which are called by either that code you posted or internally by pspDebugSioInit have different nids in 3.71, and 3.71 M33 didn't have any nids resolver.
Thanks, I got the point. This is why I found an uncertain sceSysconCtrlHRPower surrogate (with a big number in the name) that runs as silk, so I gotta resolve all the kernel calls nids, or change to cf390.
Given it has a nids resolver, I still didn't read the 390 docs. I did mistake because I thought that compiling for 150 (e.g. with no specifications) an placing under 150 folder will work avoiding nids stuff, as long as you play it on a fat psp, as far as I understand now, 371m33 needs a need resolution at any case for calls in the prx.. (compiled the old school way and placing all in kernel mode and in the 150 folder make it work, I tried). Correct me if I'm wrong.

Thanks!
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

WEll, if you are using it in the 1.5 kernel, and you installed the addon, there is no need of changing nids, as the 1.5 kernel will have the correct nids.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

Hi rus_pa!!
Are you loading the prx in kernel mode?? No HW mess-up allowed in user-mode...are you managing k1 stuff?? Have you the latest pspsdk environment??
Try all this and then try downloading from svn the latest
pspsdk.h
pspsyscon.h
(and related libs...)

see you soon
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

hy jean ;) Yes I provide k1 stuff and run in kernel mode, I think the problem is somewhat related to the makefile, as far as I tried sometimes I get the same missing reference error also in normal one-file all-kernel-mode source pspDebugSioInit() calls, but only in certain cases.
This is uncommon since when I drop the siotest example it compile and works, so I think the cause is a messy makefile, tonite I'm gonna doublecheck everything, but I bet the missing parameter the friend suggested me in the first reply will make the difference.
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

no way, I gotta figure out another way, also this code returns a

Code: Select all

main.o&#58; In function `_sioInit'&#58;
/cygdrive/c/pspdev/_code/003_sioprx/main.c&#58;105&#58; undefined reference to `sceSysconCtrlHRPower'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;sioprx.elf&#93; Error 1
still cannot get past this
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

I got it, don't know still exactly why, but even if I have the same sdk and the same fw version of your one, jean, I gotta replace sceSysconCtrlHRPower with sceSyscon_driver_44439604 that afaik is the direct call mapped somewhere in the libraries.
Perhaps It'd be possible our systems differ for an update or something like that. Actually I shot in my code the remote example with some very light modifications and it runs smoothly. I will investigate the code, let's see if I can find a reason for that difference (quite nasty indeed).
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

I just made a simple netbeans app with a lousy form to spit whatever textfield text through the serial port I have, and I experience HUGE data loss (I read char by char and I loss data when spitting in a string, for example).
Damn, no chance I gotta dig it a little deeper :D :D :D
User avatar
jean
Posts: 489
Joined: Sat Jan 05, 2008 2:44 am

Post by jean »

no way, I gotta figure out another way
I experience HUGE data loss
If you take a look to (1000) already done discussions and working sources, nobody will shoot you in the head :) No new issues here.
rus_pa
Posts: 13
Joined: Mon Jan 07, 2008 9:42 am

Post by rus_pa »

Don't you worry ;) just a statement!
Post Reply