Fatal Error[Pe035]: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"

Hi All,

I am getting following error while compiling template example with DSP CMSIS library in IAR.

Fatal Error[Pe035]: #error directive: "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" \nRF5_SDK_11.0.0_89a8197\components\toolchain\CMSIS\Include\core_cm4.h 165

Does anyone has any idea regarding this?

  • well the error message seems very clear doesn't it. Have you checked __FPU_PRESENT to see if it's set or not? If not, why not. A very quick check shows __FPU_PRESENT is set in nrf52.h, are you not including that, are you trying to build the code for nrf51?

  • 0
    58 pts.
    in reply to RK

    Hi Rk,

    Thanks for your response. I am working on nrf52 and included the nrf52.h file in the project. Following is the code that I am trying to compile

        #include <arm_math.h>
    #include <math.h>
    #include <stdio.h>
    
    #include "nrf52.h"
    #include "nrf_gpio.h"
    #include "nordic_common.h"
    #include "nrf_delay.h"
    #include "app_error.h"
    #include "app_timer.h"
    #include "app_util_platform.h"
    #include "boards.h"
    #include "bsp.h"
    
    int main()
    {
      float32_t f_input_cmsis_dsp = 2;
      float32_t f_result_cmsis_dsp;
      
      float f_input = 2;
      float f_result;
      
      /* Using CMSIS-DSP library */
      arm_sqrt_f32(f_input_cmsis_dsp,&f_result_cmsis_dsp);
      printf("f1: %f\n",f_result_cmsis_dsp);
      
      /* Standard math function */
      f_result = sqrt(f_input);
      printf("f2: %f\n",f_result);
      
      return 0;
    }
    
  • 0
    58 pts.
    in reply to RK

    One more thing is that __FPU_PRESENT in nrf52.h is already set to 1.

  • 0
    25473 pts.
    in reply to RK

    You need to have:

    #include "arm_const_structs.h"
    #include "arm_math.h"
    

    after the #include "nrf52.h"

    You also need to configure the Library configuration as shown here.

  • 0
    58 pts.
    in reply to RK

    Hi Sigured,

    Thanks for your reply. I am looking onto the link that you have suggested. Its really helpful. I have resolve this issue. But can anyone implemented any basic transforms in NRF52 and IAR. Do you have link for this sample example.

    Also there are no sample projects on DSP library?

Related