Как добавить функции преобразования из библиотеки CMSIS DSP в Makefile?

Я написал код, который использовал функцию arm_cfft_f32 из библиотеки CMSIS DSP. Как добавить библиотеку CMSIS DSP в Makefile моего проекта?

Makefile, созданный STM32CubeMX для чипов STM32F407. Я скопировал .c и .h из папки CMSIS статистики, функций преобразования и фильтрации в свой файл проекта в \ Src и \ Inc.

В Makefile в C_SOURCES, созданном STM32CubeMX, я добавил:

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_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

person user2575085    schedule 20.10.2019    source источник
comment
Я добавил arm_cfft_radix8_f32.c в C_SOURCES и оставил следующее: main.c: 188: undefined ссылка на arm_cfft_sR_f32_len1024'. What does CMSIS defined arm_cfft_sR_f32_len1024?   -  person user2575085    schedule 20.10.2019
comment
У меня функция cfft определена как fallow, arm_cfft_f32 (& arm_cfft_sR_f32_len1024, fft_buffer, 0, 1);   -  person user2575085    schedule 20.10.2019
comment
Я использовал arm_cfft_sR_f32_len1024, определенный в arm_const_structs.c, поэтому добавил в C_SOURCES. Теперь у меня ошибка: build / arm_const_structs.o :(. Rodata.arm_cfft_sR_f32_len1024 + 0x4): undefined ссылка на twiddleCoef_1024'" and "build/arm_const_structs.o:(.rodata.arm_cfft_sR_f32_len1024+0x8): undefined reference to armBitRevIndexTable1024 '   -  person user2575085    schedule 20.10.2019


Ответы (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 в вашу систему и ссылаться на них в make-файле в C_SOURCES и добавить заголовок в C_INCLUDES.

person user2575085    schedule 20.10.2019
comment
+ в ASM_SOURCES добавлен Src / arm_bitreversal2.s - person user2575085; 20.10.2019