Hello every one;
I'm recently interested in learning ARM microcontroller and I'm a newbie in this field.
in order to experience memory addressing for this microcontroller I have written a program in KEIL uvision for AT91SAM7x256 chip.
after preprocessor instructions this is first line of my program:
int var __attribute__((at(0x00200000)))=0x68;
for this instruction I have no errors.
BUT when I change this command to:
int var __attribute__((at(0x00200000)));
(assume I don't want to initialize the variable at the beginning of the execution)
but compiler gives the error: (Variable_Addressing is the name of my program)
.\Variable_Addressing.axf: Error: L6971E: variable_addressing.o(.data) type RW incompatible with variable_addressing.o(.ARM.__AT_0x00200000) type ZI in er RW_IRAM1.
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 1 error messages.
what's the reason? why without initialization compiler gives an error?
and for second state I changed the instruction to:
int var __attribute__((at(0x0020FFF0)))=0x68;
or
int var __attribute__((at(0x00200F00)))=0x68;
the compiler gives following error:
.\Variable_Addressing.axf: Error: L6971E: variable_addressing.o(.ARM.__AT_0x0020FFF0) type RW incompatible with sam7.o(STACK) type ZI in er RW_IRAM1.
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 1 error messages.
as you know AT91SAM7x256 has a 64 KB SRAM and address of SRAM first cell is 0x0020 0000.
so the addresses 0x0020 FFF0 and 0x0020 0F00 both are in the SRAM addressin range (64KB=0x0000 FFFF \[\to\] 0x0020 0000 + 0x0000 FFFF = 0x0020 FFFF and both adresses mentioned above are in this range)
what is the reason? (Notice that both addresses are factors of number 4 (as compiler expects for int variable))
I use KEIL \[\mu\]Vision 4.73.0.0 version.
Thank you in advance