i'm trying to use an external flash memory Winbond 25q64jvsiq for my Arduino Nano based project for audio recording purposes, to have extra memory for recording 1 byte audio samples, since Arduino nano SRAM memory is too small (8kb), to store at least 1 second of 8 kHz 8 bit samples audio. I'm trying to understand the basics of bytes storing in my external memory. I'm using SPIMemory library for that, and i can't find a function to erase 1 byte, there is only sectorErase() function. So i wonder is it even possible to erase a single byte of external memory?
Here is a part of code where i try to rewrite (erase one byte and write a new one) a next byte when the button pressed, but when it erase a sector it erases not the one byte but all bytes behind it, and i want to manipulate it more accurate, and erase only one byte:
if(!digitalRead(5)){ //button pressed
if(e<3){
e++;
flash.eraseSector(count); //erasing a byte
flash.writeByte(count,e,NOERRCHK); // write a new value
} else {
e=0;
flash.eraseSector(count);
flash.writeByte(count,e,NOERRCHK);
}
}