MKE02Z64 writing EEPROM with IntFLASH component with interrupts enabled?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MKE02Z64 writing EEPROM with IntFLASH component with interrupts enabled?

跳至解决方案
2,148 次查看
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

标签 (1)
标记 (4)
0 项奖励
回复
1 解答
1,824 次查看
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 项奖励
回复
4 回复数
1,824 次查看
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 项奖励
回复
1,824 次查看
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 项奖励
回复
1,824 次查看
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 项奖励
回复
1,825 次查看
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 项奖励
回复