This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

wierd float64_t vs. float32_t

Hi, I have wierd experience about using float32_t. This is my test:

When i use operations on float64_t i got:

0.0001s   MAIN:INFO:init_finished
0.0001s   MAIN:INFO:loop
0.5077s   MAIN:INFO:loop //timer interrupt
0.4978s   MAIN:INFO:loop //timer interrupt
0.4970s   MAIN:INFO:loop //timer interrupt

normal timer interrupt which happend every 500ms.

in main i have:

for (;;)
{
  NRF_LOG_INFO("loop\n");
  power_manage();
}

but when i use float32_t i have strange interrupts:

0.0001s   MAIN:INFO:init_finished
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop
0.0001s   MAIN:INFO:loop

Does this have any sense?

I use nrf52 with sdk 12.2.0 i have this code:

#define ARM_MATH_CM4
#include "arm_const_structs.h"
#include "arm_math.h"

and flags

CFLAGS += -mfloat-abi=hard
CFLAGS += -mfpu=fpv4-sp-d16
LDFLAGS += -mfloat-abi=hard
LDFLAGS += -mfpu=fpv4-sp-d16
Parents Reply Children
Related