Comments (23)
This problem seems not to occur with older version of the Code Sourcery toolchain (<2008q3) or the self-built tool chain. It seems also be partly fixed in cdad71d for current Codebench toolchain but re-appears when compiling without optimization (-O0).
from riot.
Is this problem still existent?
from riot.
Yes.
from riot.
Can we maybe find a way to omit the usage of printf+float at all?
As I am a big fan of the newlib nano.specs, which don't have the printf+float capability at all, it would be nice if RIOT works completely without using this...
from riot.
Can we maybe live with this issue, as #1352 solves the problem for to my knowledge the only part in RIOT where we depend on printing floats?!
from riot.
We print floats in other places too...
$ git grep 'printf.*%f' | grep 'c:'
dist/tools/linux-border_router/testing.c: printf("%d, %f\n", runs_per_test, interval);
dist/tools/linux-border_router/testing.c: sprintf(command, "ping6 -v -f -c %d -i %f -W 1 abcd::d",
drivers/cc110x/cc1100_phy.c: printf("WOR receive time: 0x%.2X (%f ms)\r\n", cc1100_wor_config.rx_time_reg,
drivers/lm75a/lm75a-temp-sensor.c: printf("hystTemp = %f\n", lm75A_get_hysteresis_temperature());
drivers/lm75a/lm75a-temp-sensor.c: printf("overTemp = %f\n", lm75A_get_over_temperature());
drivers/lm75a/lm75a-temp-sensor.c: printf("initialHystTemp = %f\n", lm75A_get_hysteresis_temperature());
drivers/lm75a/lm75a-temp-sensor.c: printf("initialOverTemp = %f\n", lm75A_get_over_temperature());
drivers/lm75a/lm75a-temp-sensor.c: printf("hystTemp = %f\n", lm75A_get_hysteresis_temperature());
drivers/lm75a/lm75a-temp-sensor.c: printf("overTemp = %f\n", lm75A_get_over_temperature());
sys/net/routing/rpl/of_mrhof.c: printf("Metric for parent returned: %f", etx_value);
sys/ping/ping.c: printf("%s%f%s\n", "time=", rtt, "ms");
sys/shell/commands/sc_sht11.c: printf("Temperature offset set to %f\n", (double) sht11_temperature_offset);
tests/test_bloom/main.c: printf("%f false positive rate.\n", false_positive_rate);
tests/test_bloom_bytes/main.c: printf("%f false positive rate.\n", false_positive_rate);
from riot.
oh damn, I only looked at core... So I guess this issue it not fixable too easily?
from riot.
But it looks that most of these calls can be rather easily replaced.
from riot.
I'm with @OlegHahm
from riot.
But is there something more elegant than
printf("WOR receive time: 0x%.2X (%u.%u ms)\r\n",
cc1100_wor_config.rx_time_reg,
(unsigned) cc1100_wor_config.rx_time_ms,
(unsigned) ((cc1100_wor_config.rx_time_ms - ((unsigned) cc1100_wor_config.rx_time_ms)) * 1000));
without using libmath?
from riot.
Anyone with a nice idea?
from riot.
not really.
from riot.
It is still happening with CodeBench Lite 2014.05-28 and GNU Tools for ARM Embedded Processors 4.9.3 20141119.
Still no workaround?
from riot.
Just an idea: try building without nano.specs, i.e. full functionality
newlib. It should be somewhere in the makefile.include for the board or
CPU.
(I am not at my computer right now and I don't know anything about the code
bench tool chain so I can't provide any more information)
On Feb 20, 2015 2:41 PM, "timmmmmey" [email protected] wrote:
It is still happening with CodeBench Lite 2014.05-28 and GNU Tools for ARM
Embedded Processors 4.9.3 20141119.
Still no work around?—
Reply to this email directly or view it on GitHub
#17 (comment).
from riot.
this issue is quite old, but I came across this link command option several days ago: -u _printf_float
or -u _scanf_float
respectively for newlib-nano. According to the docs this should pull in float support for printf/scanf. Can someone test this?
from riot.
And while testing, do a code size comparison! I guess that would be most interesting here.
from riot.
Is this still an issue?
from riot.
It is related to #5094 ?
from riot.
Does #5094 solve it or only partly?
from riot.
I have a printf test improvement in the works which will reveal other missing format identifiers.
With the current default build options on Mulle the float %f
specifier is simply ignored, native works fine without changes. I guess that means that all other newlib_nano platforms are broken too..
Adding LINKFLAGS += -u _printf_float
or USEMODULE += printf_float
to the Makefile fixes the problem on my machine, but it adds about 8 kB ROM usage..
from riot.
#5094 solves the problem on mulle. (Add USEMODULE += printf_float
to Makefile)
from riot.
Good! Can we close this?
from riot.
yes, let's close this
from riot.
Related Issues (20)
- Removing a TNT global address then adding a new one does not work
- msp430: DWARF line info data is bigger than the space remaining in the section HOT 17
- Deletion of old Wiki Pages HOT 4
- DHCPv6 client: Handling of NotOnLink incorrect HOT 2
- dns_msg_parse_reply() fails for response from DNS64 service
- [tracking] fixing stdio HOT 1
- README in Filesystem example is inconsistent with actual code HOT 4
- 6ln RA PIO with L flag set is not ignored
- [tracking] improving the onboarding experience HOT 12
- gnrc/ipv6: "invalid payload length" - corrupted IPv6 header when ENABLE_DEBUG=1 in mbox.c
- Add information on which features are provided by each board HOT 1
- Allow resizing of the side-nav (in Firefox) HOT 2
- Implement Neighbor Discovery Proxy (RFC 4389) HOT 1
- add board for Flipper Zero
- Make Kconfig data visible in documentation HOT 1
- C2Rust failes on native on Arch HOT 14
- Rust sys/wrapper version out-of-tree users get can fall behind
- Microchip vendor files migration process
- examples/psa_crypto: key_bits usage doesn't match specification
- usbus/dfu: cannot detach device to reboot into bootloader HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riot.