Example: S32K144 EEEPROM usage

File uploaded by Jiri Kral Employee on Jan 23, 2018Last modified by Jiri Kral Employee on May 10, 2018
Version 2Show Document
  • View in full screen mode

 Example shows how to configure PE Micro debugger to be able use FlexNVM as
 backup for EEEPROM - Emulated EEPROM  (Backup size 64kB, EEEPROM size 4kB) and preserve the backup
 memory. Configuration can be found in debugger Advanced Options.



 In the example is data structure located in FlexRAM section by linker file.
 FlexRAM data change cause flash store on background. Prior each data
 change you shall check if previous flash operation is done.



 In the example are two ways of FlexRAM (configured as an EEEPROM) usage:


  •  Direct access (up to 4 bytes can be stored once)
  •  IO Functions


 By direct access you can store only data up to 4 bytes. There is no way how
 to use memory move functions like memcpy/strcpy. In this case you need to
 use functions for store arrays or 4 bytes+ types like double.


 Part of example is LPIT timer storing runtime counter (seconds) each minute.


 PE Micro configuration:
 Enable partitioning for the device - code: 0x0204
 Preserve memory - range: 10000000-1000FFFF