Question
fatfs disk error
Posted on January 11, 2017 at 14:59
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??