This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Compile error when calling arm_sin_f32() function

At the end of the main function in the igpio_led_output.uvprojx project, a piece of code is added to generate a sine wave array, and two header files, math.h and arm_math.h, are added at the beginning:

#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_gpio.h"
#include "stdio.h"
#include <math.h>
#include "arm_math.h"

#include "pin_mux.h"
#include "clock_config.h"




    while (1)
    {
        delay();
                delay();
                delay();
                delay();
#if (defined(FSL_FEATURE_IGPIO_HAS_DR_TOGGLE) && (FSL_FEATURE_IGPIO_HAS_DR_TOGGLE == 1))
        GPIO_PortToggle(EXAMPLE_LED_GPIO, 1u << EXAMPLE_LED_GPIO_PIN);
#else
        if (g_pinSet)
        {
            GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 0U);
            g_pinSet = false;
        }
        else
        {
            GPIO_PinWrite(EXAMPLE_LED_GPIO, EXAMPLE_LED_GPIO_PIN, 1U);
            g_pinSet = true;
        }
#endif /* FSL_FEATURE_IGPIO_HAS_DR_TOGGLE */
               
                for(i=0; i< block_size; i++){
//                xTimeWave[i] = testdatas[i];   
                xTimeWave[i] = arm_sin_f32(2*PI*ff*i);
                printf("%d,%8.6f,\r\n",i,xTimeWave[i]);
//                sprintf(printstr, "%04d=%8.6f\r\n", i, xTimeWave[i]);
//                PRINTF(printstr);
                }
    }

Compile error message:
compiling arm_sin_f32.c...
../../../../../../CMSIS/Include/core_cm.h(81): error: #35: #error directive: "Compiler generates FPU instructions for a device without an FPU ( check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
..\..\..\..\..\..\CMSIS\DSP_Lib\Source\FastMathFunctions\arm_sin_f32.c: 0 warnings, 1 error

Excuse me, where is the problem?
Thanks!

0