2010-02-24 07:46:05     Change segment size

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

2010-02-24 07:46:05     Change segment size

Morten Winkler (DENMARK)

Message: 86449   

 

Hi all.

 

I am programming the BF561 bare metal. At the time being using only core A.

 

Everything works fine, but when my program exceeds a certain limit make says:

 

bfin-elf-gcc -Wall -c -mcpu=bf561 -g main.c -o main.o

bfin-elf-gcc -o vss -mcpu=bf561 main.o ad-da.o  lib/pins.o  lib/system.o lib/uart.o lib/stringlist.o

/usr/lib/gcc/bfin-elf/4.1.2/../../../../bfin-elf/bin/ld: region MEM_L1_CODE is full (vss section .text)

/usr/lib/gcc/bfin-elf/4.1.2/../../../../bfin-elf/bin/ld: region MEM_L1_CODE is full (vss section .text)

/usr/lib/gcc/bfin-elf/4.1.2/../../../../bfin-elf/bin/ld: section .init [ffa00000 -> ffa00011] overlaps section .text [ffa00000 -> ffa04eb7]

/usr/lib/gcc/bfin-elf/4.1.2/../../../../bfin-elf/bin/ld: vss: section .text lma 0xffa00000 overlaps previous sections

/usr/lib/gcc/bfin-elf/4.1.2/../../../../bfin-elf/bin/ld: vss: section .fini lma 0xffa00012 overlaps previous sections

collect2: ld returned 1 exit status

 

 

So, I've tried to modify /usr/bfin-elf/lib/bf561.ld from

 

MEMORY

{

  MEM_L1_CODE : ORIGIN = 0xFFA00000, LENGTH = 0x4000

  MEM_L1_CODE_CACHE : ORIGIN = 0xFFA10000, LENGTH = 0x4000

  MEM_L1_SCRATCH : ORIGIN = 0xFFB00000, LENGTH = 0x1000

  MEM_L1_DATA_B : ORIGIN = 0xFF900000, LENGTH = 0x8000

  MEM_L1_DATA_A : ORIGIN = 0xFF800000, LENGTH = 0x8000

 

  MEM_L2 : ORIGIN = 0xFEB00000, LENGTH = 0x20000

}

 

to

 

MEMORY

{

  MEM_L1_CODE : ORIGIN = 0xFFA00000, LENGTH = 0x8000

.... unmodified lines....

}

 

as I believed it would double my program space. This satisfies the linker, but my program stops working when I execute it on the processor.

 

My board has 64Mb of RAM and using all of it would be nice.

 

Is what I have done totally wrong. If not, what have I missed doing or forgot. Any pointer or help would be greatly apreciated.

 

 

 

Best,

 

   Morten

QuoteReplyEditDelete

 

 

2010-02-24 08:26:38     Re: Change segment size

Mike Frysinger (UNITED STATES)

Message: 86456   

 

dont touch the default linker script let alone screw with the memory map.  i dont know why you think it's OK to arbitrarily declare a L1 ISRAM region as 0x8000 when the datasheet clearly shows it being 0x4000.

 

if your code is too big to fit into the default linker map, make your own.  the amount of external memory doesnt matter if you dont place anything into it let alone actually initialize it.

QuoteReplyEditDelete

 

 

2010-02-25 01:58:01     Re: Change segment size

Morten Winkler (DENMARK)

Message: 86494   

 

Ok. I'll look into that then.

 

Thank you for your reply.

 

Morten

QuoteReplyEditDelete

 

 

2010-02-25 04:26:59     Re: Change segment size

Mike Frysinger (UNITED STATES)

Message: 86526   

 

if you look in the toolchain svn, there should be an example using custom linker scripts and external memory:

examples/standalone/bf537-stamp/sdc-cplb-init/

 

hopefully that helps

QuoteReplyEditDelete

 

 

2010-03-09 04:48:01     Re: Change segment size

Morten Winkler (DENMARK)

Message: 87000   

 

Hi Mike.

 

Great link. Thank you very much.

 

Morten

Attachments

    Outcomes