In the eeprom_18xx_43xx.c file, the following function (specifically bolded part) is incorrect:
void Chip_EEPROM_EraseProgramPage(LPC_EEPROM_T *pEEPROM)
{
Chip_EEPROM_ClearIntStatus(pEEPROM, EEPROM_CMD_ERASE_PRG_PAGE);
Chip_EEPROM_SetCmd(pEEPROM, EEPROM_CMD_ERASE_PRG_PAGE);
Chip_EEPROM_WaitForIntStatus(pEEPROM, EEPROM_INT_ENDOFPROG);
}
Instead, it should read:
void Chip_EEPROM_EraseProgramPage(LPC_EEPROM_T *pEEPROM)
{
Chip_EEPROM_ClearIntStatus(pEEPROM, EEPROM_INT_ENDOFPROG);
Chip_EEPROM_SetCmd(pEEPROM, EEPROM_CMD_ERASE_PRG_PAGE);
Chip_EEPROM_WaitForIntStatus(pEEPROM, EEPROM_INT_ENDOFPROG);
}
Hi otsl,
Thank you very much for your pointed code bug.
Yes, Chip_EEPROM_ClearIntStatus function should call EEPROM_INT_ENDOFPROG = (1<<2), this is correct in writing and understanding.
EEPROM_CMD_ERASE_PRG_PAGE = 6, this also can make the function result correct.
Chip_EEPROM_ClearIntStatus(pEEPROM, EEPROM_CMD_ERASE_PRG_PAGE);
But in the code understanding, it is wrong.
I will report this bug to our according department.
Thanks a lot for your effort.
Have a great day,
Kerry
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------