I know this topic has been addressed several times on this forum, but my need is slightly different. I was able to edit the linker file to adjust the RAM segment and then add something like this as well:
alpha = 0x0200;
Then I declared an extern variable named alpha in my code file. However, as far as I know, the only way to assign a value to this memory location is by using an instruction within the main function, which will end up being put in the code memory section. Instead of this, I need to be able to write to this memory location outside of my code memory section, just as the initial vector interrupt values are stored in a location that's discontinuous from the rest of the programmed flash. The reason for this is my checksum. If I have to include the actual value of the checksum as part of an instruction in my code memory section, then the value would need to be recursive. I tried declaring and initializing my extern variable alpha globally as a way around this:
extern unsigned short alpha = 0xAAAA;
main()
{
...
}
This did not work though. Is there any other way to do this?