cancel
Showing results for 
Search instead for 
Did you mean: 

I cant display the value via UART.

demir
Senior II

Hi,

I wrote an application as below which prints formatted values. However, when I print the Adc.IntSensTmp, I dont see the value as expected. Instead, I see the output below. Could you pls help me resolve ?

Thanks.

 

demir_0-1708283156485.pngdemir_1-1708283178472.pngdemir_2-1708283202000.png

demir_3-1708283299424.png

Here is the output I get.

 

demir_4-1708283324545.png

 

 

3 REPLIES 3

Need to enable the floating point printf() libraries, or use dtoa()

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thank you very much. 

I did it by enabling a flag as below.

Project -- > properties --> C/C++ Build --> settings --> MCU GCC Linker --> Misc --> Other flags

add -u_printf_float

demir_0-1708287779885.png

 

TDK
Guru

There are dedicated checkboxes for this in STM32CubeIDE.

TDK_0-1708289693979.png

The compiler also issues a warning about this if you have "%f" in a printf statement without those checkboxes enabled.

If you feel a post has answered your question, please click "Accept as Solution".