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

Explicitly assign the variable to a speicified RAM location

Hello,

I'd like to assign the variable to a speicified RAM location, for example, there is a variable Var which I'd like to assign to the address 0xB000, is there any way it can be achieved?

In the help document, I only find something like user-defined section, but it seems that it can only be used for a C file, but I'd like to used something inside a C file and only affect one variable? I am using C166 compiler.

Thank,
Simon

Parents
  • Hello Per,

    In my appliation, there are some variables that we call them safety critical variables, the others are non saftey critical variables. I want to put all the safety critical variables in a absolute location, but those variables are defined in the different C source file. I once used Freecale Codewarrior, there are something like "#pragma section" which can help me do it. But I don't find the similar thing in Keil C166. So that's why I post this message.

    Thanks,
    Simon

Reply
  • Hello Per,

    In my appliation, there are some variables that we call them safety critical variables, the others are non saftey critical variables. I want to put all the safety critical variables in a absolute location, but those variables are defined in the different C source file. I once used Freecale Codewarrior, there are something like "#pragma section" which can help me do it. But I don't find the similar thing in Keil C166. So that's why I post this message.

    Thanks,
    Simon

Children