2019-11-05 03:43 AM
where i have enabled fatfs and usb mass storage in cubemx and generated a project,
i have tested the usb mass storage successfuly ,when plugged in my pc it is able to detect the usb as mass storage and prompts to format it.
This is were i am stuck:
I have not integrated fatfs into it , i am using an external spi flash i have the drivers they are tested and working fine(4K min sector erase, byte read,byte write) i have come
across files (user_diskio.c & usbd_storage_if.c) should i add my spi flash driver function in these files.
The user_diskio.c has functions like:
DRESULT USER_write (
BYTE pdrv, /* Physical drive nmuber to identify the drive */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address in LBA */
UINT count /* Number of sectors to write */
)
{ }
The usbd_storage_if.c has functions like:
STORAGE_Write_FS(uint8_t lun, uint8_t *buf, uint32_t blk_addr, uint16_t blk_len)
{ }
these functions are only for initialize,read,write,card info.Why cant i find function that will use erase function of spi flash. I did refer example with similar application targeting sd card, but still could not get the fatfs to work with spi flash.
Kindly help,if any one has worked on integrating the fatfs to an external spi flash along with the usb, Thanks in advance.
2019-11-17 10:18 PM
same thing i want to implement