Erasing a flash sector

Started by Uncle Buzz, November 28, 2019, 04:41:58 AM

Uncle Buzz

Since we have to erase flash memory before writing any value, I'm wondering if we have to pass the exact first address of a sector to SPIFlash::blockErase4K(uint32_t addr) or if the flash will erase the sector who owns the address?

Should I compute the sector address or can I give the address where I want to write?

Felix

I believe you have to pass the address of the sector/block you're trying to erase.
See the datasheet of the 4MBIT Windbond chip.