gpt4 book ai didi

c - 如何将 CMSIS DSP 库中的转换函数添加到 Makefile 中?

转载 作者:行者123 更新时间:2023-11-30 16:11:54 26 4
gpt4 key购买 nike

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

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 \

通过将arm_max_f32.c和arm_cmplx_mag_f32.c添加到Makefile中,编译没有问题。但是,当我在项目中添加arm_cft_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

最佳答案

我认为这可能对某人有帮助。将以下文件添加到项目 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 下添加 header 。

关于c - 如何将 CMSIS DSP 库中的转换函数添加到 Makefile 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58469303/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com