DSP functions on System Workbench and CubeMX
Hi, I’m trying to setup a project using System Workbench and CubeMX on an Nucleo Board (411RE).
Could someone tell me a step by step on how to do that?
I have an example from STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Examples\arm_fft_bin_example\ARM arm_fft_bin_example_f32 and can’t make it compile.
I add ARM_MATH_CM4 symbol on project properties, I’ve enable fpu hardware on project properties too, I’ve add __FPU_PRESENT symbol, but nothing of it seems to solve my problem:
10:36:37 **** Incremental Build of configuration Debug for project FFT_01 ****
make all
‘Building target: FFT_01.elf’
‘Invoking: MCU GCC Linker’
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -L”C:\Users\Leo Garbe\workspace_stdlib\nucleo-f411re_hal_lib\Debug” -L”C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM” -T”C:\Users\Leo Garbe\workspace_stdlib\FFT_01\LinkerScript.ld” -Wl,-Map=output.map -Wl,--gc-sections -lm -o “FFT_01.elf” @”objects.list” -lnucleo-f411re_hal_lib
src/main.o: In function `main’:
C:\Users\Leo Garbe\workspace_stdlib\FFT_01\Debug/../src/main.c:49: undefined reference to `arm_cfft_f32’
C:\Users\Leo Garbe\workspace_stdlib\FFT_01\Debug/../src/main.c:53: undefined reference to `arm_cmplx_mag_f32’
C:\Users\Leo Garbe\workspace_stdlib\FFT_01\Debug/../src/main.c:56: undefined reference to `arm_max_f32’
C:\Users\Leo Garbe\workspace_stdlib\FFT_01\Debug/../src/main.c:73: undefined reference to `arm_cfft_sR_f32_len1024’
collect2.exe: error: ld returned 1 exit status
make: *** FFT_01.elf Error 1
On the source code I have a bug symbol on
/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len1024, testInput_f32_10khz, ifftFlag, doBitReverse);
I put the cursor on arm_cfft_f32 and press F3 and took me to arm_math.h:
void arm_cfft_f32(
const arm_cfft_instance_f32 * S,
float32_t * p1,
uint8_t ifftFlag,
uint8_t bitReverseFlag);
but I don’t figure out where the source code of this function is. Is on a arm_cortexM4XX_math.lib file on STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM ?
if it is, I have a couple of them:
arm_cortexM4b_math.lib
arm_cortexM4bf_math.lib
arm_cortexM4l_math.lib
arm_cortexM4lf_math.lib
wich one should I use?
and how to add them to the project?
Thank and best regards!