AnsweredAssumed Answered

Very odd FLOP issue

Question asked by mafull on Jul 25, 2016
Latest reply on Jul 29, 2016 by Clive One
So I'm currently working on two different STM32F4 boards for two different projects, which share some code between them. These are the F407 disco and F429disco.

I recently had to switch to the GCC compiler for both projects due to Keil uVision's code size limit.

Using the same code on both devices (only changes being clock periods due to clock rate differences), I am getting very different results for the very simplest of operations:

t.durationSeconds = (double)t.duration / 1000000.0f;

duration is a uint32_t and is giving the correct value (just under 1,000,000 us for a 1 second test). durationSeconds is a double and gives either -2.0000 or -0.0000. This is only on the F407 - the F429 gives a fraction just below 1.0000 as the very basic maths suggests.

I AM SO CONFUSED.

All 'debugging' is done via UART since it's not possible to debug using the GCC compiler within Keil (I think?).

Any ideas guys (clive)? :)

Outcomes