S32K144 Flash Partitioning Example Code Query

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

S32K144 Flash Partitioning Example Code Query

1,021 次查看
Shubha_Ravi
Contributor I

Hello Team, 

EEPROM Partitioning is required for our project so, I am trying to run Flash Partitioning example code on S32K144 EVB with S32DS 3.4 having 4.0.2 RTM. 

My Observations:

1. The values written in P-Flash(0x7F000) as well as EEPROM(0x14000000) is same as the source buffer (0-255) which is how the example code is expected to work, after reset i can see the same values in the respected memory sections.

2. I then updated the source buffer[i] = 8 to verify if P-Flash and EEPROM are getting updated with new values. During runtime i see that the values were updated in memory, then i tried to reset the board and checked for the values but i saw the values as per point 1(which is 0-255) being updated rather than the value in source buffer(which is 8).

As per my understanding from AN11893, once the EEPROM memory is updated, there will be an internal statemachine that invokes a write to Backup EEPROM. According to this point i assume that write to EEPROM backup did not work since its always retaining the value from first scenario. Please look into the below images from my testing Memory_1.PNGMemory_1_after_reset.PNGMemory_2.PNGMemory_2_after_reset.PNGCan you please let me know what i am missing to get this code working?

0 项奖励
回复
3 回复数

937 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Shubha_Ravi

The data written to EEPROM can of course be updated.

 

I think the reason for your problem is that your program performs partition operations every

time or does not set up the debugger to protect the backup area data.

 

1. Partition operation only needs once.

The partition operation only needs to be performed once in the entire product cycle. In this routine, the MCU will be partitioned each time, and the content of the backup area will also be lost.

 

2. Every time you debug, it will erase the data in the backup area by default.

You can protect the partition through the following options

Senlent_0-1732697631408.png

3. Debug the code by "attach".

This options will not erase the program and data in the current MCU,this is very useful in some conditions

Senlent_1-1732697657245.png

4. You can observe without a debugger. By printing the data in the memory through Uart in the application code.

0 项奖励
回复

988 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@Shubha_Ravi

I have read your problem description carefully, but I don't know how to reproduce your problem.

Can you explain your test steps in detail, or provide a demo that can reproduce the problem, so that I can reproduce the problem based on this information, and then help you find the cause of the problem.

0 项奖励
回复

962 次查看
Shubha_Ravi
Contributor I

Hi,

 

Thanks for your response. 

I am trying to use the example attached to this message on the S32K144 EVB.

The original code contains the below statement

/* Init source data */
for (i = 0u; i < BUFFER_SIZE; i++)
{
sourceBuffer[i] = i;
}

which fills the sourcebuffer to 00,01,02,03.....FF, this value is updated in pflash and eeprom.

 

These values stays in back up and never get changed. even though i update the source buffer with differ values, write to pflash and eeprom. after power cycle I expect to see updated values to be stored from eeprom backup but i see 00,01,02....FF in both pflash and eeprom.

 

I just want to understand how to initiate eeprom backup properly and how to erase the already written values in both locations.

 

once written to eeprom backup, can't we update with new values? because I am running the same code by changing the source buffer values but after reset I see older values.

 

I tried to update the other locations in eeprom, which is working, see image below

Shubha_Ravi_0-1732626858516.png

but not on the locations which was there in original code. I still see older values, see image below

Shubha_Ravi_1-1732626931947.pngShubha_Ravi_2-1732626953639.png

 

I hope this helps to understand my problem. Please let know if you need more information.

 

Kind Regards,

Shubha

 

 

0 项奖励
回复