Hi,
Is there a way to explicitly place variable initializer values in a defined flash region using scatter files?
For example, using the scatter file below,
LOAD_ROM 0x0000 0x8000 ; Name of load region (LOAD_ROM), ; Start address for load region (0x0000), ; Maximum size of load region (0x8000) { EXEC_ROM 0x0000 0x8000 ; Name of first exec region (EXEC_ROM), ; Start address for exec region (0x0000), ; Maximum size of first exec region (0x8000) { * (+RO) ; Place all code and RO data into ; this exec region } SRAM 0x10000 0x6000 ; Name of second exec region (SRAM), ; Start address of second exec region (0x10000), ; Maximum size of second exec region (0x6000) { * (+RW, +ZI) ; Place all RW and ZI data into ; this exec region } }
If I declare
int aGlobalVar = 0xDEADBEEF;
aGlobalVar will get placed in SRAM, and the initializer value 0xDEADBEEF will get placed at the end of EXEC_ROM (this seems to be the case according to my experiment).
Is there a way for me to force explicit placement of 0xDEADBEEF in a flash region?
Thanks, LJ
The questioner there is using the load region entirely wrong.
Look it's not my job to train you to do your job, or perform your job.
If you don't understand the concepts of the scatter file, and the role of the linker, and startup code, it's not really my problem. Trying to point you in the right direction to find a solution to your issue, but not paid enough to do it for you, and get you past the mind-block where you insist it must do things a certain way without understanding how the mechanics actually work and the degrees of freedom you have to change things, or alter the outcome.
Feel free to Please read the manual, and understand it, and work with your Keil account manager to resolve your support issues.