MKE02Z64 writing EEPROM with IntFLASH component with interrupts enabled?

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

MKE02Z64 writing EEPROM with IntFLASH component with interrupts enabled?

Jump to solution
2,263 Views
sys
Contributor III

Hi all,

I would to ask a question:

I'm using MKE02Z64 with CW 10.6, and PE high-level component IntFLASH for read/write/erase oeprations on EEPROM (0x10000000 area). We would need to have interrupt enabled.

I have this doubt: could there be problems if when there is EEPROM operations and an interrupt occurs? I'm thinking about the ISR may be in flash, and also the IntFlash routines are in flash, so the event of an interrupt may create some problems (program counter changes, "context" changes,...)?

I would like to know if there could be EEPROM corruption data (or operations that dont finish well), with interrupts enabled.

Thanks in advance!

Sandro

Labels (1)
0 Kudos
Reply
1 Solution
1,939 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sandro,

    Your attached picture means :

It is possible to read from flash memory while some commands are executing on EEPROM memory. It is not possible to read from EEPROM memory while a command

is executing on flash memory.

    Today, I also test the KE02 eeprom, I enable the RTC interrupt when do EEPROM erase, program and reading, it also has no problem, so if you also do a lot of test, and have no problem, I think you can use it.

    But for the assumed system stable working, it is better to disable the interrupt before the eeprom operation in the next time.

  

Wish it helps you!


Have a great day,
Jingjing

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

View solution in original post

0 Kudos
Reply
4 Replies
1,939 Views
sys
Contributor III

Hi Jingjing,

thanks for testing and for analysis, sure it helps me :smileyhappy:

Now I know how to behave, and in the future we always run with interrupt disabled.

Thanks again!

Have a great day too

Sandro

0 Kudos
Reply
1,939 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sandro Mores,

      When you launch EEPROM operation, actually you still use the same code as the flash operation: clear FSTAT[CCIF] and wait the FSTAT[CCIF] flag is set.

So you should disable the interrupt when you launch EEPROM and Flash operation, if you enable the interrupt, your code may be running abnormally, not only just EEPROM data corrupt.

    Please disable the interrupt when you launch the EEPROM operation.

Wish it helps you!

If you still have question, please contact me!


Have a great day,
Jingjing

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

0 Kudos
Reply
1,939 Views
sys
Contributor III

Hi Jingjing,

Thanks for the answer, now I would like to go deep: we noticed that erasing/write a (whole) Flash page with interrupt enabled, lead to a system crash, also with a CPU reset.

But with Eeprom, where I write and erase single words, I never had problem of data corruption or abnormal run conditions, so I was asking us if in this case there is almost no problem. This, I was supposing, because operations in Eeprom are someway "disconnected" from Flash's ones.

I lead to this reading datasheet, there is a table in the paragraph "Allowed simultaneous flash and EEPROM operations" that explain which operations can be done simultaneously. I attach printscreen of the table. It seems that I can erase/write eeprom while reading Flash...but what this mean exactly?

Summary, I would like to know if I need to re-program all my boards just stocked...or not :-)

Wait for explanation

Thanks again,

Sandro

0 Kudos
Reply
1,940 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Sandro,

    Your attached picture means :

It is possible to read from flash memory while some commands are executing on EEPROM memory. It is not possible to read from EEPROM memory while a command

is executing on flash memory.

    Today, I also test the KE02 eeprom, I enable the RTC interrupt when do EEPROM erase, program and reading, it also has no problem, so if you also do a lot of test, and have no problem, I think you can use it.

    But for the assumed system stable working, it is better to disable the interrupt before the eeprom operation in the next time.

  

Wish it helps you!


Have a great day,
Jingjing

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

0 Kudos
Reply