Typo/Bug in EEPROM driver for LPC18xx/43xx

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Typo/Bug in EEPROM driver for LPC18xx/43xx

653件の閲覧回数
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 返信

364件の閲覧回数
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 件の賞賛