Part Number: TMS320F28379D
Tool/software: Code Composer Studio
I am using the sd card example code to learn the FATFS library. I am trying to make a file and write some data to it. The file contents are empty. Please find below the code :
FRESULT fresult;
FIL fil;
char line[] = "Hello World";
fresult = f_mount(0, &g_sFatFs);
if(fresult != FR_OK)
{
UARTprintf("f_mount error: %s\n", StringFromFresult(fresult));
return(1);
}
WORD bw =0;
fresult = f_open(&fil, "message2.txt",FA_WRITE | FA_OPEN_EXISTING);
fresult = f_write(&fil, line, (WORD)strlen(line), (void *)&bw);
f_sync(&fil);
f_close(&fil);
I am not getting any error in any of the steps.