Hello,
I'm using an MC9S12P128 MCU, and I'd like to store some constants in D-flash. I have the D-flash segment defined as
DFLASH = READ_ONLY 0x010400 TO 0x0113FF;
So, when I go to write the constant, I use the following:
#pragma CONST_SEG CAL_VAL
volatile const unsigned char __near constant1=0x7F;
When I look at where this is in the memory, it shows up as 0xC015. To me, that's nowhere in the range define above. What am I missing here?
Solved! Go to Solution.
Hi Robert.
I just made a quick test but I didn't reproduce your problem.
see attached demo code and video.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Robert.
I just made a quick test but I didn't reproduce your problem.
see attached demo code and video.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
I do not see any attachments. Can you please post?
Can't you see it?
here is the screenshot of it
Thank you, Jennie. The video was very helpful. I missed some items in the prm file.
Not sure how I missed the video. My appologies.
I hacked a solution. I defined constant1 in D-flash as follows:
const unsigned char constant1 @ 0x0400;
Then I can write to D-flash at this location, and all is well...