Hi,everybody!
I have a armlink question! in my project:I set R/W
BASE to 0x00080000,R/O BASE to 0x00000000 in the eval
mode.and my code as following:
AREA Word, CODE, READONLY EXPORT Reset_Handler Reset_Handler num EQU 20 ENTRY start LDR r0, =src LDR r1, =dst block MOV r2, #num wordcopy LDR r3, [r0], #4 STR r3, [r1], #4 destination SUBS r2, r2, #1 BNE wordcopy stop B stop AREA BlockData, DATA, READWRITE src DCD 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,1,2,3,4 dst DCD 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 END
After linking,src is set to 0x00080000,but i can't
find 1,2,3,4,.....in that address range!why?
thank you!
I don't work with this tool, but I would assume that the linker has placed a copy of the src constants in the read-only memory area. The startup code will then copy the initial values from the read-only area to the read-write area.
If you think about it: Pre-initialized RAM variables can't be stored in RAM while the hw is turned off. The compiler don't believe that your read-write area is non-volatile...
Thank your reply firstly!
There is not setup code in my project,so there is
no such problem :" copy the initial values from the
read-only area to the read-write area." and I don't
know the meaning of word "hw" in your reply? the
right values(1,2,3,4,5)locate after the read-
only area!
Thank you again!
I have solved the aboving problem!
hw is normal short form of hardware. sw is normal short form of software.