2019-07-29 04:05 AM
I have tried debugging, and the error comes whenever
f_mkfs -> find_volume-> checkfs -> move_window -> disk_write is called.
looking at it, i see the implementation in diskio.c
DRESULT disk_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 */
)
{
DRESULT res;
res = disk.drv[pdrv]->disk_write(disk.lun[pdrv], buff, sector, count);
return res;
i think its a function pointer, during debugging i cant step into it, and see its implementation in both projects.
can anyone please help me?
i have attached both projects,
however, the project FatFs_uSD_Standalone ( demo project) might not build correctly; there might be some files missing. i am not sure about how the include structure works on this project.
2019-07-29 06:37 AM
ST's model requires additional DISKIO drivers, which you select/enable with FATFS_LinkDriver()
There is typically a sd_diskio.c file with the real routines in it.
2019-07-29 07:23 AM
there is a file called sd_diskio.c.
and i am linking drivers, by calling FATFS_LinkDriver(), however, im not sure if im doing it correctly.
the project file that you have uploaded at
https://drive.google.com/open?id=0B7OY5pub_GfINVZnNXFvTGxaWmM
i couldn't find where the drivers are linked.
2019-07-29 07:49 AM
I changed the optimization settings to reflect the optimization settings of the demo project, and now f_mkfs returns the error
(3) The physical drive cannot work