Giter Site home page Giter Site logo

Comments (23)

OlegHahm avatar OlegHahm commented on May 18, 2024

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.

Kijewski avatar Kijewski commented on May 18, 2024

Is this problem still existent?

from riot.

OlegHahm avatar OlegHahm commented on May 18, 2024

Yes.

from riot.

haukepetersen avatar haukepetersen commented on May 18, 2024

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.

haukepetersen avatar haukepetersen commented on May 18, 2024

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.

LudwigKnuepfer avatar LudwigKnuepfer commented on May 18, 2024

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.

haukepetersen avatar haukepetersen commented on May 18, 2024

oh damn, I only looked at core... So I guess this issue it not fixable too easily?

from riot.

OlegHahm avatar OlegHahm commented on May 18, 2024

But it looks that most of these calls can be rather easily replaced.

from riot.

LudwigKnuepfer avatar LudwigKnuepfer commented on May 18, 2024

I'm with @OlegHahm

from riot.

OlegHahm avatar OlegHahm commented on May 18, 2024

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.

OlegHahm avatar OlegHahm commented on May 18, 2024

Anyone with a nice idea?

from riot.

haukepetersen avatar haukepetersen commented on May 18, 2024

not really.

from riot.

timmmmmey avatar timmmmmey commented on May 18, 2024

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.

jnohlgard avatar jnohlgard commented on May 18, 2024

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.

cgundogan avatar cgundogan commented on May 18, 2024

this issue is quite old, but I came across this link command option several days ago: -u _printf_float or -u _scanf_floatrespectively for newlib-nano. According to the docs this should pull in float support for printf/scanf. Can someone test this?

from riot.

haukepetersen avatar haukepetersen commented on May 18, 2024

And while testing, do a code size comparison! I guess that would be most interesting here.

from riot.

miri64 avatar miri64 commented on May 18, 2024

Is this still an issue?

from riot.

kYc0o avatar kYc0o commented on May 18, 2024

It is related to #5094 ?

from riot.

miri64 avatar miri64 commented on May 18, 2024

Does #5094 solve it or only partly?

from riot.

jnohlgard avatar jnohlgard commented on May 18, 2024

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.

jnohlgard avatar jnohlgard commented on May 18, 2024

#5094 solves the problem on mulle. (Add USEMODULE += printf_float to Makefile)

from riot.

kYc0o avatar kYc0o commented on May 18, 2024

Good! Can we close this?

from riot.

jnohlgard avatar jnohlgard commented on May 18, 2024

yes, let's close this

from riot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.