2020-03-08 03:31 PM
Hi,
I am currently using the Nucleo H743ZI board to interface with an SD card to Read/Write some data. I am using SDMMC in 1 bit mode to achieve this. I wrote the generic code (given below) to perform the write function. While using STM32CUBEIDE V1.2.0 however, I am unable to write data onto the SD card. During debugging I paused the program to check where the problem occurs. It appears as if the program never comes out of the f_mount function and is stuck there. Do you have any thoughts on this?
CODE:
FATFS myFATAFS;
FIL myFILE;
UINT testByte;
if(f_mount(&myFATAFS, SD_Path, 1)== FR_OK)
{
HAL_GPIO_TogglePin(GPIOB,GPIO_PIN_7);
char myPath[]="WRITE1.TXT\0";
f_open(&myFILE, myPath, FA_WRITE | FA_CREATE_ALWAYS);
char myData[] = "Hello World\0";
f_write(&myFILE, myData, sizeof(myData), &testByte);
f_close(&myFILE);
}
I have seen other threads where this problem has been discussed to no real conclusion
Can you help me out with this?