2349454_en-US

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

2349454_en-US

2349454_en-US

lpc4078 eeprom page erase clarification required

I'm using an LPC4078 and MCUXpresso and experimenting with storing values in Eeprom.

I want to write a few bytes in the middle of a page without clearing the whole page.

Looking in the datasheet, it says that after writing the data to be written int he page register, it still has to be programmed into non-volatile memeory and that is done with the erase/program operation.

Does the Erase/Program operation erase the whole page or just the area of the page I have new data for, and how does it know? - the address setting for Erase/Program ignores the 6 lsbs so it only knows the page.

The UM10562.pdf isn't explicitly clear on this matter.

Thanks

Alex

Re: lpc4078 eeprom page erase clarification required

I attach a workspace with the mentioned project in it. I ran it on an LPC4078 using a lpc-link2 debugger.
(I couldn't be bothered to get semihosting to work, so I used breakpoints and inspected the data)

Re: lpc4078 eeprom page erase clarification required

Hello @alex_conway 

For LPC4078 EEPROM, the minimum erase/program unit is one page (64 bytes). Therefore, each erase/program operation will erase the entire page. If you want to write only a few bytes, please first read the whole page, then modify the required bytes, and finally perform an erase/program operation on the page. You can test this on your side.
 
Thank you.
 
BR
Alice
Re: lpc4078 eeprom page erase clarification required

Hi Alice,

My experiments demonstrate otherwise:

I wrote a small program using the lpc_board_ea_devkin_4088 library and the periph_eeprom demo project to start me up.

I erase a page of Eeprom and read it back. To my surprise the results are all '\0' instead of 0xFF

Then I write 'ABCDEFG\0' to address 0 in that page and read the page back. I receive 'ABCDEFG\0'

Then I write 'ABCDEFG\0' to address 7 in that page and read the page back. I receive 'ABCDEFGABCDEFG\0'

This is all as expected except for two things:

1. after erasing the eeprom reads 0

2. looking at the implementation of Chip_EEPROM_Write() is can seem no read-modify-erase-write sequence. There is only Chip_EEPROM_WritePageRegister followed by Chip_EEPROM_EraseProgramPag.

This is why I asked the question.

Thanks

Alex

Re: lpc4078 eeprom page erase clarification required

I've got semihosting to work after adding a newline to all my printf strings! Also clearer evidence of everything I have said:
Erasing sets Eeprom to 0x00
The code does not perform a read-modify-erase-write sequence, just erase-write.
The LPC4078 seems to only erase the locations that are written to when erasing.

I would really like clarification on this.

Thanks

Alex

Re: lpc4078 eeprom page erase clarification required

Despite "Escalating" whatever that means, there has been no further response from NXP on this.
I still need clarification. 

Re: lpc4078 eeprom page erase clarification required

Hi @alex_conway 

Thanks for your reply, and I apologize for the delayed response.

Unfortunately, our community script was previously broken, so customer replies did not trigger case update notifications in our internal system. I sincerely apologize for the delay.

Regarding the EEPROM on the LPC4078, according to the User Manual, all communication with the actual EEPROM block is performed through a 64-byte page buffer. Therefore, please make sure your EEPROM operations follow the requirements described in the User Manual.


Alice_Yang_1-1788510957201.pngAlice_Yang_1-1788510957201.pngAlice_Yang_1-1788510957201.pngAlice_Yang_1-1788510957201.png

Alice_Yang_0-1788510947469.pngAlice_Yang_0-1788510947469.pngAlice_Yang_0-1788510947469.pngAlice_Yang_0-1788510947469.png

At this point, we cannot determine whether there is an issue unless the EEPROM is being accessed according to these requirements.

Thank you.


BR

Alice

Re: lpc4078 eeprom page erase clarification required

Hi Alice,

I'm using the functions in eeprom_17xx_40xx.h and eeprom_17xx_40xx.c (provided by NXP and included in the project I attached)

The Chip_EEPROM_Write() function calls the Chip_EEPROM_WritePageRegister() function followed by Chip_EEPROM_EraseProgramPage()

The Chip_EEPROM_WritePageRegister()function sets the EEPROM Address using the Chip_EEPROM_SetAddr() function which takes care of shifting and blanking the lower 6 bits.
Then the data bytes are written to the EEPROM write data register (WDATA) using the Chip_EEPROM_WriteData() function

The Chip_EEPROM_EraseProgramPage() uses the Chip_EEPROM_SetAddr() function to set the page address, anables the erase/page-program bit and waits for programming to finish.

I cannot see any code that reads the exisitng EEPROM data in the page to perform a page-read-modify-write.
However, as demonstrated in my project, It appears that the EEPROM page erase does not erase the whole page, but only erases at the addresses with new data loaded into the write data register.

Thanks

Alex

タグ(1)
評価なし
バージョン履歴
最終更新日:
昨日
更新者: