Hello,
Trying to print floats using printf, e.g.,
float d = 1.0;
printf("d = %f", d);
But it prints out:
d =
Also sprintf doesn' work with floating point numbers;
My assumption is that the floating point is not enabled in the compiler? If that is the case, I'm not sure what the flag is to enable?
Version of compiler:
xtensa-lx106-elf-gcc --version
xtensa-lx106-elf-gcc (crosstool-NG esp-2020r3-49-gd5524c1) 8.4.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks,
Andy ...
ESP8266_RTOS_SDK How do you printf floats?
Re: ESP8266_RTOS_SDK How do you printf floats?
Postby Gowtham » Thu Dec 17, 2020 5:40 pm
I am also faced this problem after enabling floating point in make menuconfig solved.
Make Menuconfig->Components Config->Newlib->Change newLib value level to float nano.
Make Menuconfig->Components Config->Newlib->Change newLib value level to float nano.
I am a firmware developer. 

Who is online
Users browsing this forum: No registered users and 186 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.