AnsweredAssumed Answered

stm32F4 FPU Question

Question asked by terter etuet on Jul 24, 2017
Latest reply on Jul 24, 2017 by waclawek.jan

Hello,

i am trying to work with the fpu of the stm32f469-Disco and got some questions...

i am on ac6 systemworkbench/win7/

 

so far i can compile and run my app that uses float math...

when i look at the disassmbly it looks good: (as far as i can understand this, it uses the fpu-commands vadd.f32, vmul.f32 etc)

 

0800c842:   beq.n   0x800c8cc <main()+588>
 545              test = 1.0f / (float)(ix%4) + test;
0800c844:   ldrh    r3, [r7, #50]   ; 0x32
0800c846:   uxth    r3, r3
0800c848:   and.w   r3, r3, #3
0800c84c:   vmov    s15, r3
0800c850:   vcvt.f32.s32    s15, s15
0800c854:   vmov.f32        s13, #112       ; 0x70
0800c858:   vdiv.f32        s14, s13, s15
0800c85c:   vldr    s15, [r7, #44]  ; 0x2c
0800c860:   vadd.f32        s15, s14, s15
etc

 

but:

__FPU_USED is 0 because __VFP_FP__ is not defined (core_cm4.h line 149)

and SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));  /* set CP10 and CP11 Full Access */

doesent get set

 

SystemInit(void){

  #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));  /* set CP10 and CP11 Full Access */
  #endif

....

}

shouldent this generate a FPU-FAULT?

 

and where can i define __VFP_FP__ ?  putting in

dident help...

 

many thanks for some enlightment!

Outcomes