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
  • If you have critical variables that should survive a reboot, then a simple method is to modify your project and reduce the size of RAM.

    Then you can define a struct with all the variables that should survive a reset. Set such a struct pointer to this memory area and access the relevant fields, after having checked a CRC of the struct to figure out if the content is valid.

Reply
  • If you have critical variables that should survive a reboot, then a simple method is to modify your project and reduce the size of RAM.

    Then you can define a struct with all the variables that should survive a reset. Set such a struct pointer to this memory area and access the relevant fields, after having checked a CRC of the struct to figure out if the content is valid.

Children