Preserve internal non volatile memory

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

Preserve internal non volatile memory

1,435 Views
youssef
Contributor II

Hi,

FlexRAM and NVM are partitioned and configured correctly. Emulated and backup eeprom are working fine. My issue is when I use the debugger to flash program, eeprom saved data are wiped. I used advanced options in debugger configuration without success.

pastedImage_1.png

How to keep internal eeprom data when using the debugger?

PS: I'm using PEMicro as debugger.

0 Kudos
Reply
2 Replies

1,178 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

make sure that Emergency Kinetis Device Recovery is unchecked: 
pastedImage_1.png

In my case - I can see data from last debug session after Flash Init or when FlexNVM is partitioned to EEEPROM by Pe Micro. 

Jiri  

0 Kudos
Reply

1,178 Views
youssef
Contributor II

Hi Jiri,

Yes the Emergency Kinetis Device Recovery is always unchecked in my debugger configuration.

Every time when I make a change in my code, so the object file changes, the debugger will erase my preserved section eeprom. Even so, the log shows that the section is preserved, "Preserving data range $10000000-$1000FFFF before erase ... ".. But section is erased , eeprom data are wiped... 

;version 1.02, 01/20/2017, Copyright 2017 P&E Microcomputer Systems, Inc. All rights reserved. www.pemicro.com [s32k144f512m15_x_pflash_dflash_eeprom_rev2]

;device freescale, s32k144f512m15, pflash_dflash_eeprom

;begin_cs device=$00000000, length=$14001000, ram=$20000000

Loading programming algorithm ... 

WARNING - Selected .ARP file has been modified. CRC16 = $6A9F 
Done.
CMD>VC
Verifying object file CRC-16 to device ranges ... 
block 00000000-000003FF ... 
Ok. 
block 00000410-000071F3 ... 
Ok. 
block 00007FFC-00007FFF ... 
Ok. 
block 00009000-0000989F ... 
Calculated CRC-16 does not match block. (File = $F6FB, Device = $FC84) 

CMD>EM
Preserving data range $10000000-$1000FFFF before erase ... 
Done.

Erasing.
Module has been erased.
Reloading programming algorithm ... 
done.
Re-programming preserved data range $10000000-$1000FFFF ... 
Done.
CMD>PM

Programming.
Processing Object File Data ... 


. 
Programmed.
CMD>VC
Verifying object file CRC-16 to device ranges ... 
block 00000000-000003FF ... 
Ok. 
block 00000410-000071F3 ... 
Ok. 
block 00007FFC-00007FFF ... 
Ok. 
block 00009000-0000989F ... 
Ok. 
block 0000A000-00022873 ... 
Ok. 
block 0007FFAC-0007FFFF ... 
Ok. 
Checksum Verification Successful. (Cumulative CRC-16=$599C) 

CMD>RE

Initializing.
Target has been RESET and is active.

The only way that the debugger will keep data in eeprom is when the object file does not change, so flash is not reprogrammed at all...

Verifying object file CRC-16 to device ranges ... 
block 00000000-000003FF ... 
Ok. 
block 00000410-000071F3 ... 
Ok. 
block 00007FFC-00007FFF ... 
Ok. 
block 00009000-0000989F ... 
Ok. 
block 0000A000-00022873 ... 
Ok. 
block 0007FFAC-0007FFFF ... 
Ok. 
Checksum Verification Successful. (Cumulative CRC-16=$599C) 
Application verified in memory. No need to reprogram. 

CMD>RE

Initializing.
Target has been RESET and is active.

I still canot figure out how to keep my data in eeprom when flash is being reprogrammed...

PS: EEPROM partitionning is not done from PE micro configuration. It is part of my initialization code...

Youssef

0 Kudos
Reply