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.

Compiler/MSP430F5529: How to enable full printf float support for GNU v6.4.0.32 SOMNIUM on CCS v7.3.0

Part Number: MSP430F5529

Tool/software: TI C/C++ Compiler

Upgraded from CCS v6.1.1 to CCS v7.3.0. This also required changing the MSP430 compiler from GNU v4.9.1 (Red Hat) to GNU v6.4.0.32 (SOMNIUM Technologies Limited). As a result, code that previously printed floats using printf, no longer prints floats. Unlike the TI compiler, there does not appear to be any option to select levels of printf float support for the GNU compiler. There are additional complications associated with changing from the GNU compiler to the TI compiler, so please don't suggest that. I am looking for a way to enable full printf float support using the GNU compiler. If anyone knows how to do that, please help. Thanks.  

  • Is it accurate to say you can printf strings and ints, but not floats?  Please check to make sure you are not running out of stack or heap.

    Thanks and regards,

    -George

  • Thank you for the link, however I had already found that, and it was not helpful. I did confirm that if I switched to the TI compiler that it was possible to select the level of printf support (nofloat, minimal, or full) as shown on the screenshots. However, switching from the GNU compiler to the TI compiler causes a host of other compatibility problems, and I don't want to trade off 1 issue for 10 others.

    I am looking for assistance to select the GNU compiler printf support. 

  • Yes, printf prints strings, ints, etc., just not floats. There is no problem with stack/heap. This issue of default printf support level is not new. I spent hours googling it, and finding recent information is impeded by the years of complaints of this same issue happening on and off with compiler changes in the past.

    Part of the problem appears to be that the software engineers working on the compilers don't stick to a consistent decision on this issue, and keep changing the default support level based on personal preference. That's annoying, but I would be OK with it if there was a simple way to modify the support level.

    It appears in this case with the GNU v6.4.0.32 SOMNIUM compiler, they decided to change the default to something less than "full" support, and forgot to add a way to adjust it in the settings menus. It is possible that there is a compiler flag method to set this manually like "--printf_support=full", I'd be happy if someone knew what that was.
  • Hi,

    The key here is to undefine the symbol _printf_float on the linker options. Please check the short clip below where I show this:

    Hope this helps,

    Rafael

  • Thank you so much! Solution works! GNU Linker -> Symbols, add "_printf_float" to --undefined section.