Cycles or duration of float Multiplication on STM32F4
Hi all,
I have a question concerning the duration of float multiplication on the STM32F4. As far as I know, the chip has an FPU.
I run the following code snippet
float LagCompensator_process(LagCompensator_instance* S, float input)
{
S->x2 = input;
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_8);
S->y1 = S->p1 * (-S->p2 * S->y1 +
S->p3 * S->x2 +
S->p4 * S->x1
);
LL_GPIO_ResetOutputPin(GPIOC, LL_GPIO_PIN_8);
S->x1 = S->x2;
return S->y1;
}The duration between the Pin Set and Reset is about 170ns. The processor runs on 180MHz.
I find the 170ns for 4 Multiplications pretty long. However, it is with float variables. Can anybody comment on this? Do I have to activate the FPU somewhere in the Project?
In the project properties, you can find
Thanks in advance for your help!
