2008-07-01 10:00:23     Using Blackfin Internal Memory

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-01 10:00:23     Using Blackfin Internal Memory

Juhi Sinha (INDIA)

Message: 58159   

 

The following code is executed on bf-537 ezkit board using tftp and gdbserver.But the data and instructions are getting stored in the SDRAM memory where we have dumped uClinux kernel.array1 is stored at the location 0x37d05b0

 

-------------------------------------------------------------------------------------------------------------------------------------

 

#include <stdio.h>

#include <stdlib.h>

 

int array1[100] = {5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,5,5,5,5};

int array2[20] ={1,0,2,2,0,2,2,2,0,2,4,4,4,0,4,4,0,6,6,6};

 

int main()

{

    int a=3,b=4,c=7;

    c = a + b;

    b=6;

return 2;

}

 

-----------------------------------------------------------------------------------------------------------------------------------

 

Then we tried with the following code to include data and instructions in internal memory of blackfin:

 

-----------------------------------------------------------------------------------------------------------------------------------------

 

#include <stdio.h>

#include <stdlib.h>

 

int array1[100] __attribute__ ((l1_data_A)) = {5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0,5,5,5,5};

int array2[20] __attribute__ ((l1_data_B))={1,0,2,2,0,2,2,2,0,2,4,4,4,0,4,4,0,6,6,6};

 

__attribute__ ((l1_text))

 

int main()

{

    int a=3,b=4,c=7;

    c = a + b;

    b=6;

return 2;

}

 

We got the following errors while building the code above:

 

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Building target: test

Invoking: Blackfin FLAT C Linker

bfin-uclinux-gcc -L/opt/uClinux/bfin-uclinux/bfin-uclinux/lib -mcpu=bf537-any -elf2flt -o"test"  ./first1.o 

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: section .l1.text [00000000 -> 00000023] overlaps section .text [00000000 -> 000004ff]

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: ftest.gdb: section .text lma 0x0 overlaps previous sections

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real:test.gdb: section .l1.data.A lma 0x24 overlaps previous sections

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: test.gdb: section .l1.data.B lma 0x1b4 overlaps previous sections

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: test.gdb: section .data lma 0x500 overlaps previous sections

collect2: ld returned 1 exit status

make: *** [test] Error 1

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

How can we use internal memory banks to store data and instructions?

QuoteReplyEditDelete

 

 

2008-07-01 10:13:05     Re: Using Blackfin Internal Memory

Mike Frysinger (UNITED STATES)

Message: 58160   

 

please read the documentation.  FLAT files cannot have separate sections.

 

http://docs.blackfin.uclinux.org/doku.php?id=using_l1_memory

Attachments

    Outcomes