2008-08-28 03:15:17 Issues while linking assembly code for BF537 EZ-Kit lite.
Gaurang Bhatt (INDIA)
Message: 61226
Hi,
We are working on uclinux based environment on BF537 EZ-Kit lite. We are using ethernet debugging with gdb at back end and DDD on front end.
Our assembly code.
__start:
.data
aa: .byte4 5
bb: .byte4 5
.global _main;
.type _main, STT_FUNC;
_main:
LINK 12;
nop;
nop;
P1.h=aa;P1.l=aa;
P2.H=bb;P2.L=bb;
R1 =[P1];
R2 =[P2];
R0 =0x2F;
R3 =R1+R0;
nop;
nop;
UNLINK;
RTS;
.size _main,.-_main;
1).When we try to declare the data under '.data' directive, the compilation returns with the error as below,
-ld returned with 1 exit status.
2).
>bfin-linux-uclibc-gcc -gstabs print1.s -o print1
the gdb server returns with the error while debugging
gdb) can not access memory at 0x5a67d4.
3).
>bfin-linux-uclibc-gcc -gstabs -pie -Wl,-sep-code -Wl,-code-in-l1,-z,now -Wl,-data-in-l1 print1.s -o print1".
the procesor reboots while trying to debug. the gdb server returns with error...
gdb)Ignoring packet error, continuing...
Reply contains invalid hex digit 116
QuoteReplyEditDelete
2008-08-28 09:54:31 Re: Issues while linking assembly code for BF537 EZ-Kit lite.
Mike Frysinger (UNITED STATES)
Message: 61258
what exactly are you trying to do ? why are you declaring your own __start ? why are you sticking the _main function into the .data section ? there are many problems with that code ...
QuoteReplyEditDelete
2008-09-01 07:22:10 Re: Issues while linking assembly code for BF537 EZ-Kit lite.
Gaurang Bhatt (INDIA)
Message: 61473
Sir,
We have done required changes in the code as suggested by you and now we are now able to compile & debug our assembly application code. However the code is dumped in the sdram, & not in the L1 code memory. Similarly, for the data also. We have defined our variables as under.
______________________________________________________________________________________________
.section .data
aa: byte4 5;
bb: byte4 10;
________________________________________________________________________________________________
The data in not placed in the L1 data memory.
For our main function we have tried using ".section .l1code" directive, the code gets compiled without error, but during execution, it is not taking the data from the variables. On removing the ".section .l1code" directive the code gets executed but the code is not in the L1 code memory. However, on removing this directive the code will come under ".section .data", which is not correct. So what directive we should mention for the same.
We compiled the code using the below comand.
>bfin-uclinux-gcc -g -Wl,-elf2flt print1.s -o print1
We dumped the BFLT print1 file on the board and opened the print1.gdb file with the ddd to debug.
Please let us know if possible, how to dump the code & data in the respective sections in L1 memory.
________________________________________________________________________________________________
//assembly program for addition for 2 data variables.
.section .data
aa: .byte4 10;
bb: .byte4 20;
.text
.align 4
.global _main;
_main:
nop;
p1.h=aa;p1.l=aa;
p0.h=bb;p0.l=bb;
r0=[p1];
r1=[p0];
nop;
r2=r1+r0;
nop;
_main.end:
QuoteReplyEditDelete
2008-09-01 11:52:57 Re: Issues while linking assembly code for BF537 EZ-Kit lite.
Mike Frysinger (UNITED STATES)
Message: 61484
please read the documentation. the FLAT format does not support placing different data/functions into L1. only the FDPIC format supports that.