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

how to store a variable in a particular memory location

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.........

Parents
  • 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.

Reply
  • 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.

Children
  • 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.