cancel
Showing results for 
Search instead for 
Did you mean: 

DSP functions on System Workbench and CubeMX

leogarberoglio
Associate III
Posted on July 04, 2015 at 15:46

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 fromSTM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\DSP_Lib\Examples\arm_fft_bin_example\ARMarm_fft_bin_example_f32 and can't make it compile. I addARM_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_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_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_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 onarm_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 aarm_cortexM4XX_math.lib file onSTM32Cube\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!
7 REPLIES 7
Posted on July 04, 2015 at 16:10

Need to add

arm_cortexM4lf_math.lib

for little endian, fpu, m4, ie STM32F4

Not sure how you add to project, would gets you Add, or drop it in the tree, or if there's a configuration pane for the linker. Needs to end up explicitly on the linker command line, to provide the missing definitions.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
leogarberoglio
Associate III
Posted on July 04, 2015 at 16:52

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6hu&d=%2Fa%2F0X0000000btg%2FEnY4CAwnD_u499wZd2UJKicWRI9Hzi.Ev9khrADboWM&asPdf=false
Amel NASRI
ST Employee
Posted on July 06, 2015 at 16:16

Hello elgarbe,

try to put '':''just befor the name of the library to be included ('':

arm_cortexM4lf_math.lib''), then pay attention to the paths you provided for the libraries (use the browser).

Please let me know if it is OK with this suggestion.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

leogarberoglio
Associate III
Posted on July 08, 2015 at 23:17

Ok, thats works, but I have this new errors:

18:13:20 **** Incremental Build of configuration Debug for project FFT_01 ****
make all 
'Building target: FFT_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
ucleo-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_elf'' @''objects.list'' -lnucleo-f411re_hal_lib -l:arm_cortexM4lf_math.lib
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cmplx_mag_fo): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cmplx_mag_fo)
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cfft_fo): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cfft_fo)
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cfft_radix8_fo): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_cfft_radix8_fo)
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_max_fo): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_max_fo)
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_const_structs.o): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_const_structs.o)
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: error: C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_common_tables.o): Conflicting CPU architectures 13/0
c:/ac6/systemworkbench/plugins/fr.ac6.mcu.externaltools.arm-none.win32_1.2.0.201505291716/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file C:\Users\Leo Garbe\STM32Cube\Repository\STM32Cube_FW_F4_V1.5.0\Drivers\CMSIS\Lib\ARM\arm_cortexM4lf_math.lib(arm_common_tables.o)
collect2.exe: error: ld returned 1 exit status
make: *** [FFT_elf] Error 1
18:13:20 Build Finished (took 468ms)

what is the easiest way to make fft work on F411? using CMSIS DSP? another library? why ST give HAL to us and don't support it? regards!
leogarberoglio
Associate III
Posted on July 10, 2015 at 14:26

It dosen't work, so I take source code for the CMSIS dsp math lib and add to my project. Now I can compile and FFT is working ok.

Regards

Amel NASRI
ST Employee
Posted on July 10, 2015 at 14:58

Hello elgarbe,

It is great you finally succeeded to use the DSP lib with SW4STM32.

Please note that the last reported issue is under investigation.

I'l come back to you as soon as I have more information to share.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

leogarberoglio
Associate III
Posted on July 10, 2015 at 20:55

Just one more question, is there any library from ST to give fft and other DSP functions? The only option I have is CMSIS library?

Regards