I'm using the sprintf function but it doesn't work with float and double type.
It works properly only with integer.
I found a lot of information on this problem, but referred to the codewarrior ide.
How it's possible to solve this in the kinetis dev system ?
What processor are you using? Looking at the errors it seems like KL03.
The above post were asking for printf/scanf with floating point support. Is that what you want too?
If yes attached is an example project for the FRDM-KL03Z.
Note that KL03 on the Freedom board is limited to 32KByte flash and very limited to 2KByte of SRAM.
Because of that I had to increase the compiler optimization to get the linker to work.
Thanks for your reply.
Actually I am a beginner, and yes you are right, I am using KL03 processor.
And I don't know about processor expert. I am trying to learn with demo codes provided with KDS3.0.0 IDE. when I am trying to print the float value like,
I am getting output as ' f ' only, so I searched on forum and enabled the option -u_printf_float with the following:
Properties -> C/C++ build -> Settings -> Cross ARM C Linker -> Miscellaneous -> Use float with nano printf
But, no change in the behavior of printf.
I will be thankful to you if you solve my problem
Did you ever get this to work? I cannot get the approach described in the Erich Styger article referenced above to work because his comments are referencing newlib-nano, not newlib. Any help would be appreciated.
Semihosting (and printf()) depends on the library used.
Have a look at
Do not forget to use the -specs=rdimon.specs linker option.
I hope this helps,
Please take a look at the following post created by our colleague Erich Styger, it explains how to use printf() and scanf() with floating point:
Hope it helps.
I have add -u _printf_float to the linker options to enable float/double support to printf/sprintf(), but still can not work with float, any other configuarion needed?