[En-Nut-Discussion] Function placed in iram
Andre Riesberg
andre at riesberg-net.de
Wed May 12 19:08:24 CEST 2010
Hello all,
I try to place a function in the internal RAM of an AT91SAM7SE512 (the
board is the EIR).
First I add to linker script (at91sam7se512_rom.ld) this lines:
.iram :
{
*(.iram)
. = ALIGN(4);
} > iram
My test function looks like this:
static uint32_t __attribute__ ((section(".iram"),used)) Test(void)
{
return (uint32_t) &Test;
}
Compile and link are successful. But OpenOCD give me this message:
writing 262144 bytes only - as image section is 2097164 bytes and bank
is only 262144 bytes
My application works correct, the result of function Test() is 0x200000.
The generated .bin file is more then 2MByte big and mostly filled with
0x00's. It looks that the complete area from the end of my application
up to the Test() function is filled with 0x00's.
When I place then Test() function in then .data section the generated
.bin file is much smaller and works correct too (the result of Test() is
now 0x20000000).
I think with the attribute .data the Test() function is placed in the
flash and copy during startup to the external RAM.
Whats the way to have the same functionality with .iram ?
Greetings
André
More information about the En-Nut-Discussion
mailing list