Declaring objects volatile and const
If you declare a volatile object const, it will be write-protected but it will still be stored in RAM memory as the C standard specifies.
To store the object in read-only memory instead, but still make it possible to access it as a const volatile object, define the variable like this:
const volatile int x @ "FLASH";The compiler will generate the read/write section FLASH. That section should be placed in ROM and is used for manually initializing the variables when the application starts up.
Thereafter, the initializers can be reflashed with other values at any time.
以上是从IAR的帮助文档复制来的。