STM32 FATFS with SPI FLASH
I am trying to interface a SPI flash from Winbond (W25Q64JV) with FATFS
I have no previous experience with FATFS.
I initialize FATFS in CubeMX with the option "used-defined" and modified the MAXIMUM and MINIMUM Sector Size to 4096, as it is the smallest possible erase sector dimension.
I also have a library with function to read, write, erase and other stuff in my Flash with the SPI which works fine.
I know that I only have then to completed the file "user_diskio.c" generated by CubeMX to interface my flash library with the FATFS library. Specially the functions:
DSTATUS USER_initialize (BYTE pdrv);
DSTATUS USER_status (BYTE pdrv);
DRESULT USER_read (BYTE pdrv, BYTE *buff, DWORD sector, UINT count);
DRESULT USER_write (BYTE pdrv, const BYTE *buff, DWORD sector, UINT count);
DRESULT USER_ioctl (BYTE pdrv, BYTE cmd, void *buff);
As I don't see any erase function to complete, one of my question is to know if I need to erase the sector before writing in it in the USER_write function ?
Thanks in advance for your help
