Hi,
I've one question about erase and program Flash. When I erased one sector(1K) on FLASH, but I didn't program one sector and just program 8 bytes. If I read those non-program data, it will return what data? keep data before erased or can't be read?
If the answer is it can't be read. That's mean that if I want to write only 8 bytes data to FLASH, I still need to erase one sector and program one sector. Or the non-program part can't be read. Is it right?
Regards,
Pogo
Solved! Go to Solution.
After erase you should see all ones, each bit of flash in erased sector should read as =1. Each byte in flash sector should read as =0xFF. Old data is lost. Yes, to reprogram just 8 bytes you need to erase whole sector.
Maybe CW debugger confused you? For faster operation this debugger by default caches contents of NV memory and doesn't update it from flash, EEPROM etc. It may look as if data didn't change after erase. You may change this behaviour going to Multilink->Debugging memory map menu and checking update-on-halt checkboxes to make debugger updating data from MCU memory.
After erase you should see all ones, each bit of flash in erased sector should read as =1. Each byte in flash sector should read as =0xFF. Old data is lost. Yes, to reprogram just 8 bytes you need to erase whole sector.
Maybe CW debugger confused you? For faster operation this debugger by default caches contents of NV memory and doesn't update it from flash, EEPROM etc. It may look as if data didn't change after erase. You may change this behaviour going to Multilink->Debugging memory map menu and checking update-on-halt checkboxes to make debugger updating data from MCU memory.
Hi Kef,
Thanks a lot.
Regards,
Pogo