Hi Hongjian,
Few notes for you:
1. Address 0x0efbc0 is not valid. The flash memory window is in range 0x8000~0xBFFF. So, banked address for page 0x0E should be in range 0x0E8000~0x0EBFFF
2. You should define __FAR_DATA for support initializing of paged memory (Alt+F7, Compiler for HC12, add “-D__FAR_DATA”). Note: This is necessary mainly for variables
3. You should also put CheckHead into ENTRIES section in prm file for avoiding optimizing out as an unused object. For example:
ENTRIES /* keep the following unreferenced variables */
CheckHead
END
If your constant is directly referenced in your code, this is not necessary.
4. The “const_seg” and “default” must be written with upper cases. For example: #pragma CONST_SEG DEFAULT
5. I would like to recommend to keep this rule also for your user segment name – just for better readability. For example: #pragma CONST_SEG BANK_FLASH1
6. You didn’t specify your modifications in prm file. Here is example of prm file modifications for your reference:
a)
SEGMENTS
//…
//PAGE_0E = READ_ONLY 0x0E8000 TO 0x0EBFFF;
PAGE_0E_8000 = READ_ONLY 0x0E8000 TO 0x0E80FF;
PAGE_0E = READ_ONLY 0x0E8100 TO 0x0EBFFF;
//…
END
b)
PLACEMENT
//…
BANK_FLASH1 INTO PAGE_0E_8000;
//…
END
c)
ENTRIES /* keep the following unreferenced variables */
CheckHead
END
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------