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.

Problem using f_open() of FatFS on calling from specific locations in the code

I am using the TI concerto board which an ARM M3 and C28 in the same chip. I am trying to write a file to the SD card from the M3 side using the following:

I have created a separate module just to check if the f_open() is working:

void fopen_check()
{
FATFS fatFS;
FRESULT fResult;
FIL f;

if(f_mount(0, &fatFS) != FR_OK){
return;
}
fResult = f_open(&f, "AppSpace.txt", FA_CREATE_ALWAYS | FA_WRITE);
// fResult = f_open(&f, "Systcs.txt", FA_OPEN_ALWAYS | FA_WRITE );
if(fResult != FR_OK){
System_printf("Fopen Failed \n");
System_flush();
}
else{
System_printf("Fopen PASSED \n");
System_flush();
}
f_close(&f);

}

On calling fopen_check() from my main function, I am able to get "Fopen Passed" but when I call the function from another particular .c file, I get "Fopen Failed" 

I am really confused as to why does it not work when I call the function from that particular part in my code.