emreoztoklu / FLASH_W25N01GV

w25n01gv_128Mb_Flash_driver
1 stars 0 forks source link

Erase function #1

Open lounisdz opened 1 month ago

lounisdz commented 1 month ago

First, I want to thank you for your work.

I am currently trying to implement your driver with LittleFS, and I encountered some issues with the erase functions.

In W25nxx_ChipBlockErase, which calls W25nxx_BlockErase, the next line where you check the page address (which should be the block number) might not be correct for me:


if(pageAddr > (_w25nxx.PageCount - 1))
    return W25_ERROR;

I believe it should be:

if(pageAddr > (_w25nxx.BlockCount - 1))
    return W25_ERROR;

Additionally, the page erase function may not work properly because it writes an 0xFF buffer, and if the erase command hasn't been issued beforehand, it won’t write correctly:

PUBLIC W25_RESULT_t W25nxx_PageErase(uint16_t pageno) {
    uint8_t buff[2048] = {0xFF};
    return W25nxx_WritePage(pageno, buff, 0, 0);
}

I will keep you updated

emreoztoklu commented 1 month ago

hi friend, there is no any command to erase the page area. instead of this I write the area 0xFF which means delete process.

only block area is able to delete by the command. ı would like to see your work with LİTTLEFS because ı would implement my codes with that file system. İ had no time to understand and do it so tried to write my own fssystem basicly with file desc. :)

lounisdz commented 4 weeks ago

Alright, I understand. No worries, I can share the code with you. I'm particularly interested in your file system because, in my case, LFS takes a long time to write and read. I'm currently working on creating a logging device.