LowPowerLab Forum

Software support => Coding questions => Topic started by: Uncle Buzz on November 28, 2019, 04:41:58 AM

Title: Erasing a flash sector
Post by: Uncle Buzz on November 28, 2019, 04:41:58 AM
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?
Title: Re: Erasing a flash sector
Post by: Felix on November 29, 2019, 10:29:02 AM
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 (https://www.winbond.com/resource-files/w25x40cl_f%2020140325.pdf).