Typo/Bug in EEPROM driver for LPC18xx/43xx

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

Typo/Bug in EEPROM driver for LPC18xx/43xx

1,154 次查看
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);
}

标签 (4)
0 项奖励
回复
1 回复

865 次查看
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 项奖励
回复