Interfacing STM32H7 with uSD using SDMMC
I referred a youtube video https://www.youtube.com/watch?v=I9KDN1o6924
So i followed the steps
/* USER CODE BEGIN 2 */
if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 0) != FR_OK)
{
Error_Handler();
}
else
{
if(f_mkfs((TCHAR const*)SDPath, FM_ANY, 0, rtext, sizeof(rtext)) != FR_OK)
{
Error_Handler();
}
else
{ //Open file for writing (Create)
if(f_open(&SDFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) != FR_OK)
{
Error_Handler();
}
else { //Write to the text file
res = f_write(&SDFile, wtext, strlen((char *)wtext), (void *)&byteswritten);
if((byteswritten == 0) || (res != FR_OK))
{
Error_Handler();
}
else { f_close(&SDFile); } } } } f_mount(&SDFatFS, (TCHAR const*)NULL, 0);
/* USER CODE END 2 */
In this code its unable to execute from f_mkfs
But its not showing any error during execution and i am also not understanding what is the error
FYI: I determined it was not executing from that part by using transmit function