We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all
I want to store my data used in the code at a particular specific address in RAM of the chip how can i do it .
i tried to this but got data abort error #define test ((*volatile unsigned int *)(0x00400001)
test = 0x55;
can any one help me to guide me how to go about it .
The "correct" way to do this would be telling the linker to locate your variable(s) at a certain address. The linkers documentation contains the necessary information.
The compiler's documentation also contains details of the implementation-specific language extension to allow you to do it in the 'C' source code.
You choose...
You can specify this in scatter loading file for the linker. Define the varaible to be put in fixed location as a section or in a diffrent file . Describe the section or the object file to have data region at the location you want in the sctter loading file.
Suvidh
Visit this http://www.keil.com/forum/docs/thread8677.asp for Realview C compiler attributes to do the same
I tried to this but got data abort error
#define test ((*volatile unsigned int *)(0x00400001)
That shouldn't be a surprise, really. You did realize that that address is rather unaligned, didn't you?
Looks like before you go on exploring the "how?", you should spend some more time on thinking about the "why?:", and the "is that a good idea?" aspect of this plan.