This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Specific starting address for R/W memory

I am using MDK v4 of the Keil simulator, with device ARM7TDMI, and I am having trouble getting something to work, or misunderstanding the abilities of the simulator. What I am wanting to do is start R/O memory at one address, and R/W memory at a different address. In the target options under project, I can go to "linker" and specify the base address for each. If I do so, everything seems to work properly, however any data I declare in memory inside of a READWRITE AREA still ends up in READONLY memory. So for example, if I change my R/W base to 0x4000, and I have...

     AREA Prog, DATA, READWRITE
SOME_DATA DCD 0xFFFFFFFF


then in my code, I do something like LDR r0, =SOME_DATA, it will properly load the address 0x4000 into r0. However, if I check the memory map, 0x4000 is zeroed out, and the 0xFFFFFFFF is at an address inside of R/O memory, even though it has given the correct exec/read/write permissions to the correct address. What gives? Am I misunderstanding how the architecture works, or is the simulator not doing something correctly? (I have also tried changing the address and size of the on-chip memory in the target options as well, to no avail.)