How do I read and write to the S32K144 EEPROM

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

How do I read and write to the S32K144 EEPROM

961 次查看
liqing
Contributor II

Hi NXP Team:

How do I read and write to the S32K144 EEPROM? I hope to offer a routine, thank you!

0 项奖励
1 回复

682 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi liqing,

Please refer to theflash_partitioning_S32k144 SDK example.

pastedImage_3.png

As you can see, the example uses FLASH_DRV_EEEWrite() function and reads the EEPROM by a pointer:

/* Try to write data to EEPROM if FlexRAM is configured as EEPROM */
 if (flashSSDConfig.EEESize != 0u)
 {
   address = flashSSDConfig.EERAMBase;
   size = sizeof(uint32_t);
   ret = FLASH_DRV_EEEWrite(&flashSSDConfig, address, size, sourceBuffer);
   DEV_ASSERT(STATUS_SUCCESS == ret);
 
 /* Verify the written data */
 if (*((uint32_t *)sourceBuffer) != *((uint32_t *)address))
 {
   /* Failed to write data to EEPROM */
   exit_code = 1u;
   return exit_code;
 }

Regards,

Daniel

0 项奖励