I am using Eclipse IDE for firmware development. I am using Quectel MC60 module with Winbond W25Q32JV (4 MB memory). The thing is that I am able to read/write single page.
I am facing issue with multiple page writing at once. I have to write multiple pages at once since I had erased the sector (consists of 16 pages). Before writing one page, I had to erase 1 sector.
General algorithm for writing:
main()
{
// read from memory address adr
// erase sector (16 pages)
// write at address adr
}
I want to utilize memory pages for optimum performance. Any help will be appreciated.
Thanks for your prompt response.
My pseudocode is like this:
char buff[256];
sector_erase(0); // erase first 16 pages
memset(buff,7,sizeof(buff));
for(int addr=0;addr<16;addr++)
{
write_enable();
page_program();
spi_write(addr,buff); // write page one by one and hence increment the address
while(status_register); // polling status register
}