Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Program Memory Constants
Jump...
Cancel
Locked
Locked
Replies
3 replies
Subscribers
118 subscribers
Views
2785 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
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
Program Memory Constants
tom g
over 12 years ago
Note: This was originally posted on 22nd July 2013 at
http://forums.arm.com
I am using a Cortex-M0 with Keil uVision4. How are constants located in program memory and how can these program memory constants be changed by code?
Parents
Scott Douglass
over 12 years ago
Note: This was originally posted on 24th July 2013 at
http://forums.arm.com
What is it that you're trying to accomplish?
If they change then they are not really constants; if the code is running and you change the constants (say, from a debugger) then there's no guarantee that the code will still work. For example two functions might share part of a constant literal. It might be better to store the values in variables.
The compiler has various ways encoding constants. A constant might be part of an instruction, a piece of data in the same section as code or as a separate (read only) data section.
Changing a constant at runtime (once you've located it) might be simple if it's in RAM or tricky if it's in FLASH.
Cancel
Vote up
0
Vote down
Cancel
Reply
Scott Douglass
over 12 years ago
Note: This was originally posted on 24th July 2013 at
http://forums.arm.com
What is it that you're trying to accomplish?
If they change then they are not really constants; if the code is running and you change the constants (say, from a debugger) then there's no guarantee that the code will still work. For example two functions might share part of a constant literal. It might be better to store the values in variables.
The compiler has various ways encoding constants. A constant might be part of an instruction, a piece of data in the same section as code or as a separate (read only) data section.
Changing a constant at runtime (once you've located it) might be simple if it's in RAM or tricky if it's in FLASH.
Cancel
Vote up
0
Vote down
Cancel
Children
No data