0

我正在尝试在 Atollic TrueStudio 中为我的 STM32 微控制器使用 CFFT 功能。但我无法使用任何 DSP 功能。我收到错误 - 未定义对“arm_cfft_f32”的引用和未定义对“arm_cfft_sR_f32_len16”的引用。我不知道问题是什么,因为它适用于 Keil。我究竟做错了什么?

    #include "stm32f4xx.h"
    #include "arm_math.h"
    #include "arm_const_structs.h"
    #include "core_cm4.h"
    #include "math.h"
    #define TEST_LENGTH_SAMPLES 32
    float32_t ffttestip[TEST_LENGTH_SAMPLES]={0};
    static float32_t ffttestop[TEST_LENGTH_SAMPLES/2];
    /* Private macro */
    /* Private variables */
    /* Private function prototypes */
    /* Private functions */
    uint32_t fftSize = 16;
    uint8_t ifftFlag = 0;
    uint8_t doBitReverse = 1;

     int main(void)
    {
    int i = 0;
      i=15;
      i=pow(i,2);
      /**
      *  IMPORTANT NOTE!
      *  The symbol VECT_TAB_SRAM needs to be defined when building the project
      *  if code has been located to RAM and interrupts are used. 
      *  Otherwise the interrupt table located in flash will be used.
      *  See also the <system_*.c> file and how the SystemInit() function updates 
      *  SCB->VTOR register.  
      *  E.g.  SCB->VTOR = 0x20000000;  
      */

      /* TODO - Add your application code here */
      arm_cfft_f32(&arm_cfft_sR_f32_len16, ffttestip, ifftFlag, doBitReverse);
      /* Infinite loop */
    while(1);
}

编辑 - 另外,我收到以下错误 -

Info: Internal Builder is used for build
arm-atollic-eabi-g++ -o fftreal.elf Libraries\STM32F4xx_StdPeriph_Driver\src\misc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_can.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_crc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_aes.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_tdes.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dbgmcu.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dcmi.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_fsmc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_md5.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_iwdg.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_pwr.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rng.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rtc.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sdio.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_spi.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.o Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_wwdg.o src\main.o src\startup_stm32f40xx.o src\stm32f4xx_it.o src\system_stm32f4xx.o src\tiny_printf.o -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -T../stm32f4_flash.ld -specs=nosys.specs -static -Wl,-cref,-u,Reset_Handler -Wl,-Map=fftreal.map -Wl,--gc-sections -Wl,--defsym=malloc_getpagesize_P=0x1000 -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group -specs=nano.specs 
src\main.o: In function `main':
E:\truestudio workspace\fftreal\Debug/..\src/main.cpp:70: undefined reference to `arm_rfft_f32'
collect2.exe: error: ld returned 1 exit status
4

1 回答 1

1

首先放弃这个旧的不受支持的 SPL。

其次,您需要将包含 CMSIS DSP 功能的.c文件添加到您的项目中。

最后 - 我看到的您的程序与 C++ 没有任何共同之处,那么为什么您的项目设置为 C++?

于 2018-05-01T14:31:42.167 回答