| View previous topic :: View next topic |
| Author |
Message |
Flamaros
Joined: 29 Oct 2005 Posts: 5
|
Posted: Sat Oct 29, 2005 11:25 pm Post subject: I can't call any function |
|
|
Hi I am a newbie and I am french.
I have set an environment for developping on my computer and now I try to test some code on the PS2 but can't can't call a function, but the others operations do not cause an error.
I have try to exucte code like this :
| Code: |
void test()
{
}
int main()
{
int var;
var = 2*5;
for (var = 0; var < 100; var++)
;
test();
return 0;
}
|
When I don't call function test() TV stay on naplink screen (I can see status of cable and computer connection), but when I call the test() function I have an error screen with many adresse (I don't understand this screen).
I use the Makefile of the star simulation (the first exemple in the tutorials)
PS : I use NapClient with an usb cable. |
|
| Back to top |
|
 |
Flamaros
Joined: 29 Oct 2005 Posts: 5
|
Posted: Mon Oct 31, 2005 7:33 pm Post subject: |
|
|
I have try to compile without any lib this code but there no effect, I have always the same error :
| Code: |
Naplink Exception Handler
Exception error : address Error (store)
Status: 70030C13 EPC: 0040015C BadVaddr: 81FFFFD0
...
|
Someone knows how can I analyse this screen?
I have remove -fnonnull-objects CFLAGS option in Makefile because I have the massage "cc1: unrecognized option "-fnonnull-objects", my probleme can come to here? |
|
| Back to top |
|
 |
EEUG
Joined: 13 May 2005 Posts: 136 Location: The Netherlands
|
Posted: Mon Oct 31, 2005 7:47 pm Post subject: |
|
|
| ...you can try to generate ".map" file, which will contain memory addresses of your data and functions. Then you can compare value of EPC from the exception dump with these addresses to see where approximately the program crashed. ".map" file can be generated by adding this: "-Xlinker -Map -Xlinker <map_filename>" to the linker's command line... |
|
| Back to top |
|
 |
Drakonite Site Admin

Joined: 17 Jan 2004 Posts: 989
|
Posted: Mon Oct 31, 2005 7:50 pm Post subject: |
|
|
Er... and if your function isn't a pointless empty function? _________________ Shoot Pixels Not People!
Makeshift Development |
|
| Back to top |
|
 |
Flamaros
Joined: 29 Oct 2005 Posts: 5
|
Posted: Mon Oct 31, 2005 8:13 pm Post subject: |
|
|
Here you can see my Makefile
| Code: |
PS2LIB = /usr/ps2dev
LIBDIR = $(PS2LIB)/ee/lib
INCLUDES = -I$(PS2LIB)/common/include -I$(PS2LIB)/ee/include -I/usr/include
SRC = hello.c\
# my_nprintf.c\
# hw.s
OBJS = $(SRC:.c=.o)
LCFILE = linkfile
LIBS = #-lc -lm -lkernel -lmc -lsyscall -ldebug
PREFIX = ee
AS = $(PREFIX)-gcc
CC = $(PREFIX)-gcc
CPP = cpp
LD = $(PREFIX)-gcc
DVPASM = $(PREFIX)-dvp-as
OBJDUMP = $(PREFIX)-objdump
RM = /bin/rm -f
#CFLAGS = -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -mcpu=r5900 -ffreestanding -fnonnull-objects -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c
CFLAGS = -O2 -EL -pipe -Wall -Wa,-al -fno-common -Wall -mips3 -mcpu=r5900 -ffreestanding -fno-builtin -fshort-double -nostartfiles -mlong64 -mhard-float -mno-abicalls -c
CXXFLAGS = -O2 -Wall -Wa,-al -fno-exceptions -fno-common
LDFLAGS = -Wl,-Map,$(TARGET).map -L$(LIBDIR)
.SUFFIXES : .c .s .cc .dsm
all : starsim.elf
starsim.elf : $(OBJS)
$(LD) -o $@ -T $(LCFILE) $(OBJS) $(LDFLAGS) $(LIBS)
crt0.o :
$(AS) $(CFLAGS) crt0.S -o $@ > $*.lst
.s.o :
$(AS) $(CFLAGS) $(INCLUDES) $< -o $@ > $*.lst
.S.o :
$(AS) $(CFLAGS) $(INCLUDES) $< -o $@ > $*.lst
.c.o :
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $*.o > $*.lst
.cc.o :
$(CC) $(CXXFLAGS) $(INCLUDES) -c $< -o $*.o > $*.lst
clean :
$(RM) *.o *~ *.map *.lst core *.dis *.elf
|
I now, I am trying to recompile ee-gcc |
|
| Back to top |
|
 |
EEUG
Joined: 13 May 2005 Posts: 136 Location: The Netherlands
|
Posted: Mon Oct 31, 2005 8:26 pm Post subject: |
|
|
| @Drakonite: then at least there's some hint about actual location of the problem :). In case of SMS it helped me a lot... |
|
| Back to top |
|
 |
Flamaros
Joined: 29 Oct 2005 Posts: 5
|
Posted: Mon Oct 31, 2005 8:40 pm Post subject: |
|
|
| Finally I have install the packsetup (http://ps2dev.org/ps2/Tools/Toolchain/PS2Dev_Environment_for_Win32) but I have always the same error and all sample that i have compile crash. And after the Error screen I need reboot manually the PS2 because the Napclient reset have no effect (stay on a black screen). |
|
| Back to top |
|
 |
Flamaros
Joined: 29 Oct 2005 Posts: 5
|
Posted: Mon Oct 31, 2005 9:29 pm Post subject: |
|
|
The only one sample that I can compile is pad_exemple.elf, but if I add a return before the end the programme crash.
And know I try to understand why I can't call just a printf.
I need to do something special to init or close the CPU or anything else?
I need to do something with my .elf file before use napclient? |
|
| Back to top |
|
 |
|