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?
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).