Section creation error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Section creation error

694 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gusika on Sat Oct 22 14:01:33 MST 2011
Hi,

I want to create more sections, example :
<http://support.code-red-tech.com/CodeRedWiki/PlacingData>

main.c source:
__attribute__ ((section("myBuffer"))) byte testbyte;

...
  testbyte = 0x12;
}

When debugging the code, the pointed memory address of testbyte is 0x10000000, not an 0x10001F00.

---------------- xxx_debug_mem.ld content:
MEMORY
{
  /* Define each memory region */
  MFlash64 (rx) : ORIGIN = 0x0, LENGTH = 0x10000 /* 64k */
  RamLoc8 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x1F00 /* 8k */
  myBufferRAM (rwx) : ORIGIN = 0x10001F00, LENGTH = 0x100 /* 8k */

}
  /* Define a symbol for the top of each memory region */
  __top_MFlash64 = 0x0 + 0x10000;
  __top_RamLoc8 = 0x10000000 + 0x1F00;

--------------- xxx_debug.ld content:
     ...
/* MAIN BSS SECTION */
.bss : ALIGN(4)
{
_bss = .;
*(.bss*)
*(COMMON)
. = ALIGN(4) ;
_ebss = .;
PROVIDE(end = .);
} > RamLoc8

PROVIDE(_pvHeapStart = .);
PROVIDE(_vStackTop = __top_RamLoc8 - 0);

.myBuffer : ALIGN(4)
{
*(.myBuffer)
} > myBufferRAM
}

----------------
the problems:
- why not store the specified address ?
- if clicking the "project clean" menu deleted all changes in .ld files
   Brrr !

How do I do? :)
Thx!

(note: I think the excessive decoration, can not replace the compiler due to built-in options...)
0 Kudos
Reply
2 Replies

683 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gusika on Sat Oct 22 14:24:29 MST 2011
correctly (behind "." dot :) unfortunately, no says him...)

main.c source:
__attribute__ ((section(".myBuffer"))) byte testbyte;


ok, working correctly.
0 Kudos
Reply

683 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Oct 22 14:14:29 MST 2011
Did you disable your 'Manage linker script' button?
0 Kudos
Reply