Part Number: OMAP-L138
Other Parts Discussed in Thread: OMAPL138
Tool/software: TI-RTOS
I used FatFs in my project with Sys/BIOS. I have a problem, because when I writting data to SD card I sometimes lost some data (sometimes all). When I push card to PC I don't see any files but it is partially occupied. In ffconfig.h I have FS_REENTRANT = 0 (maybe here is problem?). I tested different cards.
My short code is below.
...
FATFS_init();
...
FATFS_open(0U, NULL, &fatfsHandle);
...
for (j=0; j<20; j++){
sprintf(fname, "aa_%i.txt", j);
fresult = f_open(&MyFile, fname, FA_OPEN_ALWAYS | FA_WRITE);
for(i = 0; i < 10; i++){
f_lseek(&MyFile, f_size(&MyFile));
fresult = f_write(&MyFile, tab_string, ile_byte, (void *)&wbytes);
if(fresult == FR_OK){
//...
}
else{
//...
}
}
fresult = f_close(&MyFile);
}
...
Task_sleep(20000); //I'm pulling out the card