Hi m4l490n,
In fact, to the customer, just need to partition the FlexNVM, to define the related EEPROM size, the backup size, please note, the EEPROM backup size must be at least 16 times the EEPROM partition size in the flexRAM.

Then, the customer just need to operate the flexRAM address as the eeprom address is OK.

I don't know which kinetis chip you are using, give you an example:
#define LONGWORD_COUNTER_ADDR 0x14000040
#define WORD_COUNTER_ADDR 0x14000044
#define BYTE_COUNTER_ADDR 0x14000046
//#define WORD_COUNTER_ADDR_TEST 0x10000000
int partition_flash(int eeprom_size, int dflash_size)
{
/* Test to make sure the device is not already partitioned. If it
* is already partitioned, then return with no action performed.
*/
if ((SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00)
{
printf("\nDevice is already partitioned.\n");
return 0;
}
/* Write the FCCOB registers */
FTFL_FCCOB0 = FTFL_FCCOB0_CCOBn(0x80); // Selects the PGMPART command
FTFL_FCCOB1 = 0x00;
FTFL_FCCOB2 = 0x00;
FTFL_FCCOB3 = 0x00;
/* FCCOB4 is written with the code for the subsystem sizes (eeprom_size define) */
FTFL_FCCOB4 = eeprom_size;
/* FFCOB5 is written with the code for the Dflash size (dflash_size define) */
FTFL_FCCOB5 = dflash_size;
/* All required FCCOBx registers are written, so launch the command */
FTFL_FSTAT = FTFL_FSTAT_CCIF_MASK;
/* Wait for the command to complete */
while(!(FTFL_FSTAT & FTFL_FSTAT_CCIF_MASK));
return 1;
}
int main (void)
{
char ch;
uint32 temp=0;
#ifdef KEIL
start();
#endif
printf("\nRunning the hello_world project in K2050MHz family\n");
SCB_SHCSR|=SCB_SHCSR_BUSFAULTENA_MASK|SCB_SHCSR_MEMFAULTENA_MASK|SCB_SHCSR_USGFAULTENA_MASK;
printf("\nRunning FlexMem demo!!\n");
/* Partition the memory to enable FlexMem mode */
if ( partition_flash( 0X33, 0X03) )//0X03
{
/* Device has been partitioned for the first time, so this
* means the counters have not been initialized yet. We'll
* zero them out now.
*/
*((uint32 *)(LONGWORD_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
*((uint16 *)(WORD_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
*((uint8 *)(BYTE_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
}
//Write eeprom
*((uint32 *)(LONGWORD_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
*((uint16 *)(WORD_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
*((uint8 *)(BYTE_COUNTER_ADDR)) = 0x0;
/* Wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
printf("\nlongword counter = 0x%08X", *(uint32 *)(LONGWORD_COUNTER_ADDR));
printf("\nword counter = 0x%04X", *(uint16 *)(WORD_COUNTER_ADDR));
printf("\nbyte counter = 0x%02X", *(uint8 *)(BYTE_COUNTER_ADDR));
////////////////////////
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
temp = *((uint32 *)(LONGWORD_COUNTER_ADDR));
*((uint32 *)(LONGWORD_COUNTER_ADDR)) = (uint32) temp + 1;
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
temp = *((uint16 *)(WORD_COUNTER_ADDR));
*((uint16 *)(WORD_COUNTER_ADDR)) = (uint16) temp + 1;
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
temp = *((uint8 *)(BYTE_COUNTER_ADDR));
*((uint8 *)(BYTE_COUNTER_ADDR)) = (uint8) temp + 1;
/* Make sure the EEE is ready. If not wait for the command to complete */
while(!(FTFL_FCNFG & FTFL_FCNFG_EEERDY_MASK));
/* Display the initial counter values */
printf("\nlongword counter = 0x%08X", *(uint32 *)(LONGWORD_COUNTER_ADDR));
printf("\nword counter = 0x%04X", *(uint16 *)(WORD_COUNTER_ADDR));
printf("\nbyte counter = 0x%02X", *(uint8 *)(BYTE_COUNTER_ADDR));
printf("\nRunning FlexMem demo!!end\n");
while(1)
{
ch = getchar();
putchar(ch);
}
}
When you want to use the 64byte eeprom, you just need to operate the flexRAM, you don't need to care about the related flexNVM flash after you already partition it, the chip hardware will do it automatically.
As you know, EEPROM can be byte operation, so if you just write 20bytes, it will contains 20 bytes, not which you needed whole 64 bytes.
Wish it helps you!
If you still have questions about it, please kindly let me know.
Best Regards,
kerry