Hi,
for your code:
for (i = 0; i < 1; i++)
{
EEPROM_Write(EXAMPLE_EEPROM, u16Address, data, u16BytesToWrite);
for (j = 0; j < u16BytesToWrite / 4; j++)
{
eeprom_data = *((uint32_t *)(FSL_FEATURE_EEPROM_BASE_ADDRESS + i * u16BytesToWrite + j * 4));
if (eeprom_data != data[j])
{
err++;
PRINTF("Page %d offset %d is wrong, data is %x \r\n", i, (j * 4), eeprom_data);
}
}
PRINTF("Page %d program finished!\r\n", i);
u16Address += u16BytesToWrite;
}
The EEPROM page size is 0x4000/128=128 bytes, if you define u16BytesToWrite as 128, the EEPROM_Write() function will become page program.
Pls have a try
Generally, the wrong address will leads to hardfault error.
BR
XiangJun Rong