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
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)
Hello @alex_conway
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
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