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.

Issue with opening a file

Hi,

  I am trying to open/create a text file in keil4 IDE, in my code when i try to debug step by step, with or without setting break point in the main loop, after execution of start up code(assembly), control is not coming inside the main loop, instead it is stopping at one line at the dis assembly window shown in attached file.

 I have tried building the code with CCSv6 compiler also, here file is created, but when i try to write some content it is not being written. If i read different file by opening it in read mode(manually by writing some content) both fgets and fgetc functions pointing to NULL and EOF at single reading. Please refer the code attached and tell me where i'm doing mistake. Hope i have added header files which supports file functions in my program.
#include "inc/tm4c123gh6pm.h"
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>

FILE *f_Write = NULL;
char buf[512];

int main(void)
{
// here i tried by giving different paths by inserting USB(U:,U0:), SD card (M),
and also with default drive and flash drive.
 
    	f_Write = fopen("F:\\file4.txt","w");

    	if (!f_Write)
       	return 1;

    	fclose(f_Write);
    	return 0;
} 

Thanks & Regards, Mamatha