如何将转换功能从CMSIS DSP库添加到Makefile?

时间:2019-10-20 01:18:08

标签: c makefile stm32f4 cmsis

我编写了一个代码,该代码使用了CMSIS DSP库中的arm_cfft_f32函数。如何在我的项目的Makefile中添加CMSIS DSP库?

由STM32CubeMX为STM32F407芯片生成的Makefile。我将CMSIS统计信息中的.c和.h复制,转换和过滤函数文件夹复制到\ Src和\ Inc中的项目文件。

在STM32CubeMX生成的C_SOURCES下的Makefile中,我添加了:

Src/arm_cfft_f32.c \
Src/arm_bitreversal.c \
Src/arm_max_f32.c \
Src/arm_cmplx_mag_f32.c \

通过在Makefile中添加arm_max_f32.c和arm_cmplx_mag_f32.c,编译起来没有问题。但是,当我在项目中添加arm_cfft_f32时。我收到此编译错误,

PS C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO> make
arm-none-eabi-gcc build/main.o build/gpio.o build/adc.o build/dac.o build/dma.o build/rtc.o build/tim.o build/usart.o build/usb_device.o build/usbd_conf.o build/usbd_desc.o build/usbd_cdc_if.o build/stm32f4xx_it.o build/stm32f4xx_hal_msp.o build/arm_cfft_f32.o build/arm_bitreversal.o build/arm_max_f32.o build/arm_cmplx_mag_f32.o build/stm32f4xx_hal_pcd.o build/stm32f4xx_hal_pcd_ex.o build/stm32f4xx_ll_usb.o build/stm32f4xx_hal_adc.o build/stm32f4xx_hal_adc_ex.o build/stm32f4xx_hal_dac.o build/stm32f4xx_hal_dac_ex.o build/stm32f4xx_hal_rtc.o build/stm32f4xx_hal_rtc_ex.o build/stm32f4xx_hal_tim.o build/stm32f4xx_hal_tim_ex.o build/stm32f4xx_hal_uart.o build/stm32f4xx_hal_rcc.o build/stm32f4xx_hal_rcc_ex.o build/stm32f4xx_hal_flash.o build/stm32f4xx_hal_flash_ex.o build/stm32f4xx_hal_flash_ramfunc.o build/stm32f4xx_hal_gpio.o build/stm32f4xx_hal_dma_ex.o build/stm32f4xx_hal_dma.o build/stm32f4xx_hal_pwr.o build/stm32f4xx_hal_pwr_ex.o build/stm32f4xx_hal_cortex.o build/stm32f4xx_hal.o build/stm32f4xx_hal_exti.o build/system_stm32f4xx.o build/usbd_core.o build/usbd_ctlreq.o build/usbd_ioreq.o build/usbd_cdc.o build/startup_stm32f407xx.o build/arm_bitreversal2.o -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32F407VETx_FLASH.ld  -lc -lm -lnosys  -Wl,-Map=build/GPIO.map,--cref -Wl,--gc-sections -o build/GPIO.elf
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build/main.o: in function `main':
C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/main.c:187: undefined reference to `arm_cfft_sR_f32_len1024'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build/arm_cfft_f32.o: in function `arm_cfft_radix8by2_f32':
C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:302: undefined reference to `arm_radix8_butterfly_f32'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:304: undefined reference to `arm_radix8_butterfly_f32'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build/arm_cfft_f32.o: in function `arm_cfft_radix8by4_f32':
C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:538: undefined reference to `arm_radix8_butterfly_f32'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:540: undefined reference to `arm_radix8_butterfly_f32'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:542: undefined reference to `arm_radix8_butterfly_f32'
c:/program files (x86)/gnu tools arm embedded/8 2019-q3-update/bin/../lib/gcc/arm-none-eabi/8.3.1/../../../../arm-none-eabi/bin/ld.exe: build/arm_cfft_f32.o:C:\Radar\Interrupts\Perfect\ADC Interrupts 19\GPIO/Src/arm_cfft_f32.c:544: more undefined references to `arm_radix8_butterfly_f32' follow
collect2.exe: error: ld returned 1 exit status
make: *** [build/GPIO.elf] Error 1

1 个答案:

答案 0 :(得分:0)

我认为这可能对某人有所帮助。 在将休止文件添加到项目Makefile之后,它可以很好地编译:

Src/arm_cfft_f32.c \
Src/arm_max_f32.c \
Src/arm_cmplx_mag_f32.c \
Src/arm_cfft_radix8_f32.c \
Src/arm_const_structs.c \
Src/arm_common_tables.c \

Makefile格式由STM32CubeMX自动生成。就我而言,我将CMSIS DSP .c和.h与STM32CubeMX生成的其他文件一起进行了测试。但是,它可以从系统中的CMSIS添加到修订目录中,并在C_SOURCES下的makefile中引用它们,并在C_INCLUDES下添加标头。