Hi
I am porting an existing firmware build from Keil and also GCC where my code works. The code is for the Nordic nrf52840 which has 32bit floating point hardware
I have code as follows which works when built using Keil or GCC v6.3.1
char but[64];
float val=-3.45e+11;
sprintf(buf,"%.2f",val)
However when built using Segger IDE 4.12 it does not.
What happens is that it returns from sprintf() after about 12 seconds (as opposed instantaneously for Keil & GCC) and the value in buf has no relationship with the val.
For example, I get
Float Value= (-4294967295.\F567295)(-3.456000e+11)
and not the (-3.456000e+11) is correctly printed where the format string is "%e"
I will be most grateful for any feedback/insight to go beyond this
Look forward to hearing from you and my gratitude in advance.
I am porting an existing firmware build from Keil and also GCC where my code works. The code is for the Nordic nrf52840 which has 32bit floating point hardware
I have code as follows which works when built using Keil or GCC v6.3.1
char but[64];
float val=-3.45e+11;
sprintf(buf,"%.2f",val)
However when built using Segger IDE 4.12 it does not.
What happens is that it returns from sprintf() after about 12 seconds (as opposed instantaneously for Keil & GCC) and the value in buf has no relationship with the val.
For example, I get
Float Value= (-4294967295.\F567295)(-3.456000e+11)
and not the (-3.456000e+11) is correctly printed where the format string is "%e"
I will be most grateful for any feedback/insight to go beyond this
Look forward to hearing from you and my gratitude in advance.