I use the FlexNVM as EEPROM of the chip of MKE15Z256VLH7 to save some data. The first time i can partition successfully using the FLEXNVM_ProgramPartition function(the API of SDK 2.6.0) and the EEPROM is work. But sometimes I need to repartition the FlexNVM to change the size of the EEPROM.
When I used this function(FLEXNVM_ProgramPartition) to partition for the second time, it failed.
The error code returned is kStatus_FTFx_AccessError which from ftfx_command_sequence function.
Can you help me analyze the reasons?
Hi wanglanjun ,
Before you do the FLEXNVM_ProgramPartition, you need to do the chip mass erase at first.
Your first time works, because when you download the code, the chip already do the mass erase.
But if in your code, you want to do the second partition, you need to copy your code to RAM, and run your code from RAM, then do the flash mass erase at first.
Please try it on your side.
If you still have questions about it, please kindly let me know.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Wanglanjun,
If you are using the JLINK to erase the entire chip, I think you can do the partition again, you can try it.
About the copy function api to RAM, in IAR, you can use keyword __ramfunc .
Actually, when you already do the masserase, then you run your code, and do the flash partition, it should has no problem, I don't know how you process your second partition on your side, could you provide more details about it? But if in your project, and when you run the code, you want to do the second partition, you need to do the flash erase, as you know, all your code is running in the flash, if you want do the chip erase, then you need to copy the code to the RAM at first, otherwise your app code will be erased.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------