Re: how to print floating points in mynewt

2018-09-05 Thread Kevin Townsend
This page might be worth updating since I came to the same mistaken
conclusion based on the last line here:
http://mynewt.apache.org/v1_2_0/os/modules/baselibc/ ... and implemented my
own %f solution before discovering that there IS in fact basic float
support with FLOAT_USER. :) The current implementations has limitations
like no %.08f support, but limited or not there IS limited support for it.

On Wed, Sep 5, 2018 at 7:51 PM, Rohit Gujarathi 
wrote:

> Thanks Christopher!
>
>
> On Wed, Sep 5, 2018, 11:03 PM Christopher Collins 
> wrote:
>
> > Hi Rohit,
> >
> > baselibc does support floating point formatting, but it is not enabled
> > by default.  To enable it, set the following syscfg setting to 1 in your
> > target:
> >
> > FLOAT_USER
> >
> > baselibc's float printf support is a bit limited.  In particular, it
> > ignores precision specifiers and always prints three digits after the
> > decimal point.
> >
> > Chris
> >
> > On Wed, Sep 05, 2018 at 11:00:32PM +0530, Rohit Gujarathi wrote:
> > > Hi everyone,
> > >
> > > I am trying to print floating point in mynewt using
> > > *console_printf("%f",floating_var)* but i am unable to do so. I read
> that
> > > the baselibc does not support floating point, so I tried removing the
> > > libc/baselibc from pkg.deps: in pkg.yml so that the compiler uses
> newlib
> > > but then i hit the following error:
> > > Linking /project/bin/targets/kwp1/app/apps/bme280/bme280.elf
> > >
> > Error:/project/bin/targets/kwp1/app/hw/bsp/nrf52dk/hw_
> bsp_nrf52dk.a(gcc_startup_nrf52.o):
> > > In function `.bss_zero_loop':
> > >
> > /project/repos/apache-mynewt-core/hw/bsp/nrf52dk/src/arch/
> cortex_m4/gcc_startup_nrf52.s:182:
> > > undefined reference to `_start'
> > > collect2: error: ld returned 1 exit status
> > >
> > > how can i resolve this issue?
> > >
> > > thank you
> >
>


Re: how to print floating points in mynewt

2018-09-05 Thread Rohit Gujarathi
Thanks Christopher!


On Wed, Sep 5, 2018, 11:03 PM Christopher Collins  wrote:

> Hi Rohit,
>
> baselibc does support floating point formatting, but it is not enabled
> by default.  To enable it, set the following syscfg setting to 1 in your
> target:
>
> FLOAT_USER
>
> baselibc's float printf support is a bit limited.  In particular, it
> ignores precision specifiers and always prints three digits after the
> decimal point.
>
> Chris
>
> On Wed, Sep 05, 2018 at 11:00:32PM +0530, Rohit Gujarathi wrote:
> > Hi everyone,
> >
> > I am trying to print floating point in mynewt using
> > *console_printf("%f",floating_var)* but i am unable to do so. I read that
> > the baselibc does not support floating point, so I tried removing the
> > libc/baselibc from pkg.deps: in pkg.yml so that the compiler uses newlib
> > but then i hit the following error:
> > Linking /project/bin/targets/kwp1/app/apps/bme280/bme280.elf
> >
> Error:/project/bin/targets/kwp1/app/hw/bsp/nrf52dk/hw_bsp_nrf52dk.a(gcc_startup_nrf52.o):
> > In function `.bss_zero_loop':
> >
> /project/repos/apache-mynewt-core/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s:182:
> > undefined reference to `_start'
> > collect2: error: ld returned 1 exit status
> >
> > how can i resolve this issue?
> >
> > thank you
>


Re: how to print floating points in mynewt

2018-09-05 Thread Christopher Collins
Hi Rohit,

baselibc does support floating point formatting, but it is not enabled
by default.  To enable it, set the following syscfg setting to 1 in your
target:

FLOAT_USER

baselibc's float printf support is a bit limited.  In particular, it
ignores precision specifiers and always prints three digits after the
decimal point.

Chris

On Wed, Sep 05, 2018 at 11:00:32PM +0530, Rohit Gujarathi wrote:
> Hi everyone,
> 
> I am trying to print floating point in mynewt using
> *console_printf("%f",floating_var)* but i am unable to do so. I read that
> the baselibc does not support floating point, so I tried removing the
> libc/baselibc from pkg.deps: in pkg.yml so that the compiler uses newlib
> but then i hit the following error:
> Linking /project/bin/targets/kwp1/app/apps/bme280/bme280.elf
> Error:/project/bin/targets/kwp1/app/hw/bsp/nrf52dk/hw_bsp_nrf52dk.a(gcc_startup_nrf52.o):
> In function `.bss_zero_loop':
> /project/repos/apache-mynewt-core/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s:182:
> undefined reference to `_start'
> collect2: error: ld returned 1 exit status
> 
> how can i resolve this issue?
> 
> thank you


how to print floating points in mynewt

2018-09-05 Thread Rohit Gujarathi
Hi everyone,

I am trying to print floating point in mynewt using
*console_printf("%f",floating_var)* but i am unable to do so. I read that
the baselibc does not support floating point, so I tried removing the
libc/baselibc from pkg.deps: in pkg.yml so that the compiler uses newlib
but then i hit the following error:
Linking /project/bin/targets/kwp1/app/apps/bme280/bme280.elf
Error:/project/bin/targets/kwp1/app/hw/bsp/nrf52dk/hw_bsp_nrf52dk.a(gcc_startup_nrf52.o):
In function `.bss_zero_loop':
/project/repos/apache-mynewt-core/hw/bsp/nrf52dk/src/arch/cortex_m4/gcc_startup_nrf52.s:182:
undefined reference to `_start'
collect2: error: ld returned 1 exit status

how can i resolve this issue?

thank you