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

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?

Parents
  • 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?

  • 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;
    }
    
Reply
  • 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;
    }
    
Children
No Data
Related