We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
i want to use the dtostrf() function of stdlib.h in uvision4, because my sprintf() function of stdio.h make some mistakes by convert a float value in a string. Instead of the decimal point, value 0x20 will be set! The dtostrf() function are not located in the default library, libc.a, but in the mathematical library, libm.a. So when linking the application, the -lm option needs to be specified.
How can i include this library under uvision4? Or how can i get this function under uvision4?
Thanks for the replies!
Seb V.
I guess there is no such function in the runtime library that comes with Keil MDK. This function is not mentioned in the language standard, so you shouldn't expect it to be present. I think you should try to resolve the issue you are having with sprintf. Can you present your code? Maybe someone on this forum will be able to help?
I would suggest posting an example for review. I have no problem using sprintf() with floating point numbers in any of my applications. Also post what version of the MDK you are using. I am using 4.60 but have never had problems with my applications, I believe I started with around version 4.20.
Getting the wrong character for decimal point sounds like it could be a problem with not calling the the C library initialization code. Are you using the standard startup code for your processor?