This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to add an SD card to an existing file (DK-TM4C123G SD Source code)

Other Parts Discussed in Thread: TEST2

Dear All

How do I add a line to the end of the existing file Open?

Please let me know.

### Result ### 

MicroSD Write Test1  //  (content of existing file Open)

MicroSD Write Test2  // <-  end line (Open the file content to be added)

### Source code ###

FIL fil;
uint32_t count = 8*512;
// iFResult = f_open(&fil, "sdwrite.txt", FA_CREATE_NEW | FA_WRITE);
iFResult = f_open(&fil, "sd.txt",FA_OPEN_EXISTING | FA_WRITE);
SysCtlDelay(SysCtlClockGet()/3);
if(iFResult != FR_OK) {UARTprintf("fresult: %s\n", StringFromFResult(iFResult)); }
else{UARTprintf("\n Opened SD card\n");}


iFResult = f_write(&fil, "MicroSD Write Test2", 20, &count);
if(iFResult != FR_OK) {UARTprintf("Error writing to file: %s\n", StringFromFResult(iFResult));}
iFResult = f_close(&fil);
f_mount(0, NULL);

thanks. 

jame