| View previous topic :: View next topic |
| Author |
Message |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Mon Feb 04, 2008 8:02 am Post subject: troubles referencing sceHprmEnd |
|
|
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: |
#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("myLib", 0x1006, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
u32 k1;
int main(int argc, char **argv)
{
printf("blah blah...");
return 0;
}
//////////////////////////////////////////////////////////////////////////
int module_start(SceSize args, void *argp)
{
return 0;
}
//////////////////////////////////////////////////////////////////////////
int module_stop()
{
return 0;
}
//////////////////////////////////////////////////////////////////////////
int sioGetInt(){
return 0;
}
void sioInit(void)
{
pspDebugSioInit();
}
|
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: |
sceHprmEnd(); // I cannot compile this line
sceSysregUartIoEnable(4);
sceSysconCtrlHRPower(1);
|
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] |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Feb 04, 2008 9:11 am Post subject: |
|
|
| Well, posting the makefile is what usually help in these cases. (make sure to dd -lpsphprdm_driver to the libs) |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Mon Feb 04, 2008 9:17 am Post subject: |
|
|
| Code: |
TARGET = sioprx
#OBJS = sceDisplay_driver.o main.o
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
USE_KERNEL_LIBC=1
USE_KERNEL_LIBS=1
LIBDIR =
LDFLAGS = -mno-crt0 -nostartfiles
LIBS =
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
all:
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 |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Mon Feb 04, 2008 9:41 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Feb 04, 2008 4:47 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Mon Feb 04, 2008 5:14 pm Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Feb 04, 2008 7:25 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Mon Feb 04, 2008 11:02 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Mon Feb 04, 2008 11:10 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Tue Feb 05, 2008 4:46 am Post subject: |
|
|
no way, I gotta figure out another way, also this code returns a
| Code: |
main.o: In function `_sioInit':
/cygdrive/c/pspdev/_code/003_sioprx/main.c:105: undefined reference to `sceSysconCtrlHRPower'
collect2: ld returned 1 exit status
make: *** [sioprx.elf] Error 1
|
still cannot get past this |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Tue Feb 05, 2008 5:12 am Post subject: |
|
|
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). |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Tue Feb 05, 2008 6:41 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Tue Feb 05, 2008 10:27 am Post subject: |
|
|
| Quote: |
no way, I gotta figure out another way
|
| Quote: |
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. |
|
| Back to top |
|
 |
rus_pa
Joined: 07 Jan 2008 Posts: 13
|
Posted: Tue Feb 05, 2008 6:35 pm Post subject: |
|
|
| Don't you worry ;) just a statement! |
|
| Back to top |
|
 |
|