Skip to main content
Senior
February 18, 2024
Question

I cant display the value via UART.

  • February 18, 2024
  • 3 replies
  • 1328 views

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

 

 

    This topic has been closed for replies.

    3 replies

    Tesla DeLorean
    Guru
    February 18, 2024

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

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    demirAuthor
    Senior
    February 18, 2024

    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
    February 18, 2024

    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""."