Author Topic: Erasing a flash sector  (Read 230 times)

Uncle Buzz

  • Full Member
  • ***
  • Posts: 131
  • Country: fr
Erasing a flash sector
« 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?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6279
  • Country: us
    • LowPowerLab
Re: Erasing a flash sector
« Reply #1 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.