Other Parts Discussed in Thread: AM3352
Tool/software: TI-RTOS
Dear TI support team,
we have a custom board which features a AM3352 processor.
The processor is connected to an internal eMMC and a SD card slot (MMC0 and MMC1 peripheral).
I have implemented your FATFS procedure so far and the access to both media seems to work.
I can read/write to an already formatted SD card and the (unformatted) eMMC responds with a FR_NO_FILESYSTEM to a f_stats request.
We would like to format the eMMC in case it is not formatted yet.
I have tried to implement the f_mkfs command but it does not seem to work.
It looks like the disk_ioctl command, which is used by the f_mkfs command, is implemented but it does nothing.
As far as I've investigated, the disk_ioctl calls the registered function FATFS_diskIOctrl from the FATFS_drv.c file.
This function does some checks and returns with "RES_OK" but without doing anything.
This behaviour causes some trouble and undefined behaviour in the f_mkfs function here:
if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128) {
return FR_DISK_ERR;
}
The variable n_vol is a local variable but is not initialized.
The disk_ioctl function returns with no error but leaves the n_vol variable untouched.
Therefore I did not get an error at first but had to debug until I found the problem.
So it looks like this command is not implemented and therefore it is not possible to use the f_mkfs command.
Am I correct in the assumption that the f_mkfs command is not useable?
Thank you,
Markus