我正在尝试在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
答案 0 :(得分:1)
首先删除旧的不支持的SPL。
其次,您需要将包含CMSIS DSP功能的 .c 文件添加到您的项目中。
最后 - 我看到的程序与C ++没有任何共同之处,为什么你的项目被设置为C ++?