Typo/Bug in EEPROM driver for LPC18xx/43xx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Typo/Bug in EEPROM driver for LPC18xx/43xx

635 Views
otsl
Contributor III

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);
}

Labels (4)
0 Kudos
1 Reply

346 Views
kerryzhou
NXP TechSupport
NXP TechSupport

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);

pastedImage_6.png

   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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos