D Flash data is not getting updated correctly on mc9s12xep100 after power on.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

D Flash data is not getting updated correctly on mc9s12xep100 after power on.

492 Views
salmanshaikh
Contributor II

I am using mc9s12xep100 board and 'IEE1.c' and 'IEE1.h' to update some values in D flash.

I am using following code to read a byte from D Flash, if value is less than 50, I set value to 1,

otherwise i increment the value by 1.

But I always see the value as 1.

When I am in debug mode, this code works correctly. When in run mode I face the above problem.

uint16_t RetVal=0;
uint8_T NewData =0;
RetVal = IEE1_GetByte((IEE1_TAddress)(0x100D00), &NewData);

if(NewData > 50) {
NewData = 1; // If previous value greater than 50, set value to 1

RetVal = IEE1_SetByte((IEE1_TAddress)(0x100D00),NewData);
} else {
NewData++; // If previous value less than 50 increment value by 1
RetVal = IEE1_SetByte((IEE1_TAddress)(0x100D00),NewData);
}

Tags (1)
0 Kudos
1 Reply

401 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Salman,

To investigate your problem correctly and efficiently, please provide us the follows:
1.    your CW version:
  Start the IDE and click on Help | About Freescale CodeWarrior. Click on Installed Products.Save all info displayed into a txt file and upload it here.

2.    send the entire sample code folder(include mcp, prm,c...) in zip format to me.if your project is confidential, please create a new demo project and isolate the problem a demo code to me so that i can test it on my side directly.
3.      error screenshot.

I will check your problem based on your feedback. Thanks.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos