file located in the SRAM

Baumung Viktor Viktor.Baumung at slc-liftco.com
Thu Feb 21 11:04:52 UTC 2008


Hello,

 

I am using Cobra5485-board from senTec with ColdFire 5485?CPU.

 

The attached source Tree (test.tar.gz) was compiled with CodeSourcery
G++, compiler version 4.2.1 (Sourcery G++ 4.2-59). It is simply a "hello
world"

Application.

 

The Linker Script (cobra5485_sram.ld) was modified to put the
"sram_data.c" .data section into an external SRAM. (section "battram1").

 

The "Debug" folder contains the Makefiles for building the binary. When
the program is downloaded and started, the code jumps to address
00000000, which causes the DBug Exception Handler (invalid instruction
at PC 00000000).

 

The working Version may be compiled with the other Linker script

(cobra5485.ld)

 

Here come interesting parts of "diff -ub cobra5485.ld
cobra5485_sram.ld":

 

 MEMORY

 {

@@ -27,9 +30,12 @@

   rambar0 (rwx) : ORIGIN = 0x20000000, LENGTH = 4K

   rambar1 (rwx) : ORIGIN = 0x20002000, LENGTH = 4K

   mbar (rw) : ORIGIN = 0x10000000, LENGTH = 0x40000

+   battram1 (rw) :  ORIGIN = 0xFB800000, LENGTH = 0xA000

 }

 

-/* These force the linker to search for particular symbols from

+

+/*

+ * These force the linker to search for particular symbols from

  * the start of the link process and thus ensure the user's

  * overrides are picked up

  */

@@ -43,6 +49,7 @@

 PROVIDE(__cs3_heap_start = _end);

 PROVIDE(__cs3_heap_end = __cs3_region_start_ram +
__cs3_region_size_ram);

 

+

 SECTIONS

 {

   .text :

@@ -142,6 +149,12 @@

     _etext = .;

   } >ram

 

+  .battram1 :

+  {

+    *sram_data.o (.data* .bss* COMMON)

+    _ebattram1 = .;

+  } >battram1

+

   .cs3.rom :

   {

     __cs3_region_start_rom = .;

@@ -187,11 +200,13 @@

     *(.rambar1)

     . = ALIGN (8);

   } >rambar1

+

   .cs3.rambar1.bss :

   {

     *(.rambar1.b)

     . = ALIGN (8);

   } >rambar1

+

   /* __cs3_region_end_rambar1 is deprecated */

   __cs3_region_end_rambar1 = __cs3_region_start_rambar1 +
LENGTH(rambar1);

   __cs3_region_size_rambar1 = LENGTH(rambar1);

@@ -204,12 +219,14 @@

     __cs3_region_start_mbar = .;

     __cs3_region_init_mbar = .;

   } >mbar

+

   /* __cs3_region_end_mbar is deprecated */

   __cs3_region_end_mbar = __cs3_region_start_mbar + LENGTH(mbar);

   __cs3_region_size_mbar = LENGTH(mbar);

 

   .data :

   {

+    *(EXCLUDE_FILE(*sram_data.o) .data*)

     *(.got.plt) *(.got)

     *(.shdata)

     *(.data .data.*)

@@ -218,8 +235,10 @@

     . = ALIGN (8);

     _edata = .;

   } >ram

+

   .bss :

   {

+    *(EXCLUDE_FILE(*sram_data.o) .bss*)

     *(.shbss)

     *(.bss .bss.*)

     *(.gnu.linkonce.b.*)

 

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

Can you give a reason for this error? Attached you can find two files

 

containing the original and modified linker script.

 

Thank you very much for your support.

 

 

With kind regards

 

Viktor Baumung  



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20080221/b5689b78/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.tar.gz
Type: application/x-gzip
Size: 103907 bytes
Desc: test.tar.gz
URL: <http://sourcerytools.com/pipermail/coldfire-gnu-discuss/attachments/20080221/b5689b78/attachment.bin>


More information about the coldfire-gnu-discuss mailing list