Second partition FlexNVM failed of MKE15Z256VLH7

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

Second partition FlexNVM failed of MKE15Z256VLH7

跳至解决方案
1,440 次查看
wanglanjun
Contributor II


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?

标记 (1)
0 项奖励
回复
1 解答
1,361 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,362 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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.
-------------------------------------------------------------------------------

0 项奖励
回复
1,361 次查看
wanglanjun
Contributor II

Dear Kerry,
Thank you for your reply. How can i copy the code from FLASH to RAM? The IDE i am using is IAR for verison 8.10. Am i use __ramfunc attribute of IAR?
In the test, I will use j-link to erase the entire chip, and then partition again. Maybe, partitioning will succeed in this way. What‘s more, the device of MKE15Z256VLH7 contains the following types of flash memory:
• Program flash memory — non-volatile flash memory that can execute program code.
• FlexMemory.
Now my partitioned flash is FlexMemory not Program flash memory, the code is stored in program flash memory, why should i copy the code from FLASH to RAM? Can you tell me why?

0 项奖励
回复
1,361 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

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.
-------------------------------------------------------------------------------

0 项奖励
回复