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.

FIle read write in CCS 5.2.1

Hi ,

I am trying to do a simple file read write in CCS 5.2.1 .

I am not sure if any settings need to be changed to do C I/O on CCS .

My code (minus C I/O) works fine ,but hangs on using any C I/O function like fopen while running on simulator(Texas Instruments Simulator)

The device i have selected in my CCS settings  is  Generic CortexM3 device.

I have allocated a heap size of 0x400 through the linker settings option of CCS 

i  have also tried choosing run time support library in CCS setting to automatic and  other like rtsv7M3_T_le_eabi.lib ,but no success ..

Any help  will be appreciated .Please let me know if any further details of the issue is required

Thanks

Sunil

  • The first thing I would suggest is to try increasing the heap and stack size. A stack size of 0x400 usually works for me for a simple printf statement, however fopen and other C I/O routines may require more. Have you had a look at this wiki that covers other tips when working with C I/O?
    http://processors.wiki.ti.com/index.php/Tips_for_using_printf

  • Hi Sunil,

                 I tried writing a simple program doing file operation with heap size of 0x400 and it looks working fine.

    I am using Cortex M3 cycle accurate simulator.

    I would like you to move to latest version of CCS release. The one which you are using looks very old and this would contain older version of simulator.

    Again if you want us to investigate this further , please share the binary file to reproduce the problem.

     

    BR/Abhilash

  • Thanks BR/Abhilash !

    I also tried the same creating a new dummy project and it worked for me too only.

    Then i released that the problem might be with the _c_int00 function which i am using .

    I have used my own _c_int00 rather than the one available from run time support library.

    If i switch back to the latter  the code works fine . My own _c_int00 doesn't have  any code for setting up for heap and that might be the problem.

    I have to find out how to do the same in my _c_int00 function ,then things might work ...

    Thanks once again for the suggestions

    Regards

    Sunil