AnsweredAssumed Answered

fatfs disk error

Question asked by eb3484 on Jan 11, 2017
Latest reply on Jan 17, 2017 by eb3484

Hi,

I am using fatfs sdio with my stm32f429 mcu , i can, open read, write files correctly. When i plug out the sd card from my board at runtime, the f_open, f_write and f_read functions do not work and so i can not open or write anything to file, until i reset the mcu. I use for open and write sequence with my code below:

 if(f_mount(&SDFatFs, "0:", 0) == FR_OK)//sd kart yazma işlemleri    
  {      
    if(f_open(&MyFile, "STM32.TXT", FA_CREATE_ALWAYS | FA_WRITE) == FR_OK)      
    {        
      if(f_write(&MyFile, (const void *)wtext, sizeof(wtext), (void *)&wbytes) == FR_OK);        
      {          
        f_close(&MyFile);        
      }      
    }    
  }

 

Any advise??

Outcomes