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.

Printf,Scanf is not working

Other Parts Discussed in Thread: CONTROLSUITE

HI,

  I am using CCS5.3.0009. I am using F28M36x device. In the blinky project i put some printf and scanf. But both are not working.

Please tell what i need to change to print the statement.

Thanks in Advance

Thirumoorthy.R

  •  

     

    Hi

    There is a lot of posts about sprintf here. It is bad idea to use it. Try to use snprintf instead or ftoa or itoa or something else. Standard printf/sprintf implementation is very ineffective because of strict correspondence to the ANSI printf function. Read this forum for details. As for me I've used K&R itoa function implementation instead sprintf some time ago. The code looks very nice )))

    By the way, what do you mean "printf is not working"? May be you are runing your application from flash and does not initialize some RAM regions? 

     

     

     

     

  • Hi,

       I want to print some debug statement in the console window. For that i am using printf and scanf in C:\ti\controlSUITE\device_support\f28m35x\v160\F28M35x_examples_Master\usb_dev_serial. Printf, scanf is working in this project.

    But same printf and scanf i try to use in blinky project. But It is not print anything in the console window.

    I want to print my data,s in the console window. And read some value from console window.

    Please help me to print my datas in console window.

    Thanks in Advance

    Thirumoorthy.R

  • Try increasing the stack size.  C I/O functions use a lot of stack.  If the stack is too small, the function (e.g., printf) just silently fails.

    Note that C I/O is intrusive to the CPU.  That is, it halts the program while the data transfer takes place.  You should not use it if your application is real time (e.g., motor control or something like that).

    - David

  • Hi David,

      Thanks for more information. But I cant increase my stack size more than 400. In the other program also stack size is 400 only. I am using these printf scanf statement for checking the IPC function. I am just writing the code for Testing the IPC communication.

    Thanks in Advance

    Thirumoorthy.R

  • Make sure the "Set C I/O breakpoint" (something like that) is enabled in the CCS project options.  It is somewhere in there.  I cannot check exactly where in the options it is right now.  Without this option set, C I/O will not work.

    - David