Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Error in VARIABLE ALLOCATION in ARM keil uvision

Status
Not open for further replies.

MisaghSepehr

Newbie level 6
Joined
Jul 15, 2010
Messages
14
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,283
Activity points
1,384
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
 
Last edited:

The memory locations are apparently assigned in the linker script (or whatever defines the memory layout) and can't be used at will.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top