2025-06-09 3:25 AM
Hello,
I am working on a project using the STM32H750B-DK board with an eMMC storage device, interfaced via the SDMMC1 peripheral and the FatFs library for file operations. However, I am unable to read or write files to the eMMC.
I have implemented the drivers and example code from `~\STM32Cube_FW_H7_V1.12.1\Projects\STM32H745I-DISCO\Applications\FatFs\FatFs_Shared_Device` and `~\STM32Cube_FW_H7_V1.12.1\Drivers\BSP\STM32H750B-DK`, but we are still unable to create files or perform read/write operations on the eMMC (4GB).
I am sharing my project zip file. Any guidance on adjustments or in configuration can be a big help.
Thank You.
2025-06-09 3:57 AM
What tests/investigations/debugging have you done to find where/why it's failing ?
Does it build cleanly - ie, with no errors and no warnings?
2025-06-09 4:25 AM
@Andrew Neil
Yes , we have build the project without errors.
i have customize diskio.c for eMMC
Action: Modified diskio.c to interface with the STM32H750B-DK’s SDMMC peripheral using the HAL MMC driver.
In diskio.c , implemented the required functions (disk_initialize, disk_status, disk_read, disk_write, disk_ioctl) to call HAL functions from stm32h7xx_hal_mmc.c.
while debugging:
fres = f_mkfs("", FM_ANY, 0, workBuffer, sizeof(workBuffer));
if (fres != FR_OK) {
printf("f_mkfs failed: %d\n", fres);
}
i got fres = FR_DISK_ERR.
2025-06-09 4:55 AM
@Prajyot1 wrote:i got fres = FR_DISK_ERR.
So have you looked-up what that error code means?
Have you stepped into f_mks() to see where & why it fails?
2025-06-10 12:35 AM
yes, i stepped int f_mks() , got to know that
if (disk_write(pdrv, buf, b_vol, 1) != RES_OK) return FR_DISK_ERR; /* Write it to the VBR sector */
returning FR_DISK_ERR. function in diskio.c are not properly initialize causing failure. In that i need help..