I am trying to get a driver from a third party binary to work. Their library was compiled without using the HW FPU. I had to compile my code to use the softfp. I also added the _printf_float option. I am running on a RF52840, GCC, Eclipse, Windows, on a custom board. There seems to be issues with basic floating point commands. Here is an example:
This doesn't work but it should:
printf("%u\t%u", (unsigned int)index, (unsigned int)(power_bins_data[index] + 0.5));
This doesn't work but it should:
tempInt = (unsigned int) (power_bins_data[i] + 0.5); //fails executing this command, power_bins_data[i] is a float
printf("%u\t%u",i, tempInt);
This works:
tempFloat = power_bins_data[i] + 0.5;
tempInt = (unsigned int) (tempFloat);
printf("%u\t%u",i, tempInt);
I have never had issues with floating point before with the nRF52 or nRF51 but I always used the HW FPU.
Steve