Hi NXP Team:
How do I read and write to the S32K144 EEPROM? I hope to offer a routine, thank you!
Hi liqing,
Please refer to theflash_partitioning_S32k144 SDK example.
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