we are designing DATA loggers for Railways. For that we are using 2468 ARM processor. while designing the system we have an issue that
all local variables should be stored in INTERNAL RAM (64k) & all GLOBAL VARIABLES should be stored in EXTERNAL SDRAM.
is this feature available in KEIL ARM if so how to configure it.
Another one is how to STORE a variable in a particular memory location (global or local variable) in Keil compiler..
can any one help me.........
Before considering how to do this, please explain why you think you need to do it - there may well be better ways to achieve whatever it is that you're trying to do!
The assignment of program "objects" (functions, variables) to hardware memory addresses is done by the Linker - so you need to be studying the Linker manual for that.
The compiler does have facilities to assign an absolute memory address to a variable; see the Compiler manual - but, again, why you think you need to do it?
Replay to Are you sure that this is the best (or even a good) way to proceed? ik
Data logger is a very big project, every day it has to log 1lak packets. For this memory managemet is the big issue for us. so we are accessing the EXTERNAL memories also (SDRAMs).we have variuos modules for that we have various buffers common to all modules which are very big in size. so these buffers should be global to the system. internally we have very less memory. So our idea is to make the internal memory for the creation of local variables & external SDRAM memory for global variables creation.
will u suggest any approach......if possible
"all local variables should be stored in INTERNAL RAM (64k) & all GLOBAL VARIABLES should be stored in EXTERNAL SDRAM."
Normally, local variables would be stored on the stack, and global variables elsewhere.
So you could locate the stack in internal RAM and ensure other variables are stored elsewhere.
"Data logger is a very big project"
The Keil tools are used to dealing with large projects - it is far better to leave the tools to manage this stuff than to try to "fight" them.
Unless you have some specific problem with the way that the tools allocate memory, I would strongly recommend that you do not interfere!
If you find that you really do need to take manual control, then the Linker Scatter Loading File (or just "Scatter File" for short) is the means by which to do it. See the Linker manuals for details.
NB: it's "reply" rather than "replay"
sorry for the typing mistake.
Thanque Andy Neil.. It seems linker manual will provide some valid information. I hope i will get the solution to my problem..
In fact, all of the toolset manuals!
You said yourself this is not a trivial project - so you need to be properly prepared by making a thorough study of the necessary documentation!
The problem is i'm new to this job (project). I have no idea about this project. from last 10 years our company supplying data loggers to Indian Railways. now we want to release the new verson Data loggers. i don't know exactly my role in this project. my manager assigning me some small tasks like the queries previously i asked .thats way i am not giving clarity while asking the questions. once again thanque Ande Neil for ur valuable suggessions.
"i'm new to this job (project)"
Do you have any prior experience with embedded microcontroller development?
"I have no idea about this project ... i don't know exactly my role in this project"
You urgently need to get these things clarified with your management!
"my manager assigning me some small tasks like the queries previously i asked"
You really need to ensure that you understand your assigned tasks!
i have no prior experience in embedded controllers.
It's possible to move special variables to a separate source file and have the linker place them in a separate memory segment.
Or just access large log variables in separate segment using pointers - basiaclly just statically allocate the memory as one or more arrays of something. This works well if it's a question of storing scratch or log data separately.
Yes, of course it is possible - but is it a good idea?
If the OP can't give any reason(s) for doing this - let alone any good reasons - how can he tell whether any suggestions received here are actually appropriate to the requirement?
The only really good reason is to dedicate a fixed memory region as protected without zero-init.
And it is also possible to update firmware without losing the logged data.
But obviously, special memory regions are special for a reason - to solve a special problem. If the OP doesn't know he has a special problem, then he probably don't need to allocate some variables to a special memory region.
Special solutions should never be used without any special problems to solve. And many special problems can be rewritten to fit non-special solutions.
View all questions in Keil forum