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.

It doesn't display the text i want...



hi all,

I have a question, this is my code :

void main()

{

           int i=0;
           FILE*fs;
           fs=fopen("teks.txt","w");
           fprintf(fs,"%d\n",i);
           fclose(fs);

}


file "text" has come out, but it was empty..

Anyone can guide me what's wrong with the use of fprintf in CCSv5 ? Did I miss anything?

Many thanks.

  • Danny,

    Can you get Hello, world! to display on the console with printf?

    Regards,
    RandyP

  • thanks,

    my problem has been resolved..
    My mistake was to add the BIOS file..

    Do you know why it happened ??

    regards,
    danny...

  • Danny,

    We are glad you got your program to run correctly.

    To be clear, was your mistake that you did not add the BIOS file or that you did add the BIOS file? In other words, did the program work without the BIOS file or with the BIOS file?

    Which BIOS file are you talking about? This program should only require the Run-Time Support library and not SYS/BIOS.

    Are you running on an EVM/DSK or on the simulator?

    Which DSP are you using?

    Why do you want to use fprintf with a DSP? A better way to get debug data is to use SYS/BIOS and the System_printf command. You can refer to the SYS/BIOS documentation for more information on System_printf, or start a new thread in the BIOS forum if you are unable to find anything using the CCSv5 Help->Search tool.

    Regards,
    RandyP

  • RandyP,

    the file is DSP / BIOS V5.X Configure File ...

    I use the module dsk6713 ..

    I would like to know the value of the sampling results and I show in the file.txt to make it easier ..

    if i use system_printf, how can I find out the results of the printf ?

    regards,

    Danny.

  • Danny,

    If you use printf, or any form like fprintf, in an embedded application, you will likely lose your synchronization to real-time events when those functions execute. This is why we recommend using System_printf instead.

    Please refer to the SYS/BIOS documentation for more information on System_printf, or by using the CCSv5 Help->Search tool.

    Regards,
    RandyP