Support for double precision floats in demo MPS2 Cortex-M3 AN385


I am writing an NTP client based on this demo:

I’ve tried using the datatype double for precision floats but I’ve understood that some microcontrollers do not support doubles. Does anyone know if the demo I’ve based my project on supports double-precision floats?


Even though some MCUs have HW floating point units with or without double precision support, your compiler libraries (usually) support double precision math in software. They are slower than the HW based calculations but available.
Edit: When using GCC I think you’ve to add -lm to your linker flags when using functions from math.h.

The variety of hardware means there are lots of Arm specific GCC floating point behaviour options available. These describe the hardware available (is there a floating point unit, if so which version/model, etc.), ABI calling conventions, double precision behaviour, etc. If you want optimal performance you need to match the compiler options to your target hardware - otherwise you can use the least performant software emulation options on all hardware. Search “float” on the linked page.