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/AM5728: The floating point number can't be print out using the function printf()

Part Number: AM5728

Tool/software: Code Composer Studio

Dears,

The floating point number  can't be print out using the  function printf(),in CCS 6.13 compiler environment, on AM5728 test board.But other types of variables can be print out.

Why?

Thanks for your heip!

  • Which compiler are you using?  Your CCS version is 6.1.3 but the compiler version is separate.  If you right click on your project and select properties.  Then go to General on the left and the compiler version will be shown on the right.

    Regards,

    John

  • I did some searches on this and I am guessing that you are using GCC. From what I can tell GCC for ARM disables float for printf.

    I think you may need to change the C runtime library. I am going to move this to our compiler forum to get more expert help.

    John
  • JohnS said:
    From what I can tell GCC for ARM disables float for printf.

    Both the TI and GCC ARM compilers have options which can exclude support for floating point in printf and related functions:

    1) With the TI ARM compiler the "Level of printf/scanf support required (--printf_support)" option must be set to "full" for printf to handle floating point arguments. With TI ARM compiler v16.9.4.LTS this option is in the project properties under Build -> ARM Compiler -> Advanced Options -> Language Options:

    2) For GCC ARM compiler it is the Runtime support library under the General project properties which selects if printf supports floating point:

    The *_nano.a versions of the run time library don't support floating point arguments for printf. E.g. for both GCC v4.9.3 and v6.3.1 when using a C test program:

    - Setting the Runtime support library to libc.a allowed printf to output floating point values.

    - Setting the Runtime support library to libc_nano.c prevented printf from outputting floating point values - the floating point arguments were ignored.