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.

CCS/TMS320C6713B: How to use file read write function in C code through CCSv 3.1

Part Number: TMS320C6713B


Tool/software: Code Composer Studio

Dear

Presently, I am working on c6713 dsk and used CCSv3.1 tool. I want to create file by fopen() function

And write data into this file. Program is compiled and run successfully, but no file is created.

I have given my program code below.

 

main()

{

                int i=0;

                int data1[20]={1,3,5,9,6,10,5,11,22,14,15,17,6,0,3,12,25,44,23,10};

                FILE *fileW;

                fileW=fopen("c:/turboc/gopalsarkar/gopal37.txt","w");

 

   for (i = 0; i < 20; i++)

   {

                fprintf(fileW,"%d ",data1[i]);

   }

                fclose(fileW);

}

 

This above code is working successfully in any other c compiler.

Kindly help me if you have any solution.

Wait for your kind reply.

  • Hi Gopal,
    Other than needing to include stdio.h, your code looks fine and should work as expected. Note that there a bit more considerations when trying to use C I/O in an embedded environment than when simply building an application with Turbo C and running on your PC. Please see the below information for more details on these considerations:
    processors.wiki.ti.com/.../Tips_for_using_printf

    Thanks
    ki
  • Hi Ki

    Thanks for your reply. I have read the instruction page which you have sent to me as wiki link. But  I have followed some instructions

      and not got my solution for my problem. It may that i am not understand properly to read  this guide tutorials. Actually, I want to know the instructions,

    what should I do to solve my problem regarding this file read write function like fopen(), fprintf().

    Please help .

    Wait for your kind reply

    Regards

    Gopal Sarkar

  • Your code should work. I tried it out and it was fine. Please provide me your complete CCSv3.1 project will all required source files so I can take a look from my end.

    Thanks
    ki