Topic : STM32 address mapping

Forum : ARM

Original Post
Post Information Post
October 15, 2007 - 3:20pm
Guest

I would like to able to set data or code constants at specifics addresses. Guess that it is in the linker process that addresses are being set.
How is it possible to do to this? I tried to do this using the following method, create a section name at specific address and load data in it using the linker script?

Ex:
C code
unsigned long tab[8] __attribute__((section(".special_area")));
script:
.special_area
{

.0x20000000 : /* address

. = ALIGN(4);

*(.data)

_especial_area=.;

}>RAM

Am I right or wrong?

Replies
Post Information Post
+1
0
-1
October 15, 2007 - 4:20pm
Guest

Hi Stephane,

here is what I recommend for the linker script :

.special_area :
{
  . = 0x0 ;          /* this address is relative to the beginning of the RAM memory block */
  . = ALIGN(4) ;
  *(.special_area)   /* if you put *(.data) here, all your data will go to that section! */
  _especial_area = . ;
} >RAM

regards,
Lionel