Other Parts Discussed in Thread: CONTROLSUITE
Hi!
I have a problem with writing file to sd card. I am trying to modify example from controlSuite. File on card is created, but its empty.
diskResult = disk_initialize(0);
diskResult = disk_status(0);
fresult = f_mount(0, &g_sFatFs);
if(fresult == FR_OK)
{
fresult = f_open(file, "1stfile.txt", FA_OPEN_ALWAYS | FA_WRITE);
if(fresult == FR_OK)
{
fresult = f_write (file, "test", strlen("test"), &res);
}
fresult = f_sync (file);
f_close(file);
}
f_mount(0,&g_sFatFs);