2020-01-21 04:13 AM
Hello,
I am including the CMSIS-DSP library on my CubeMX project on Additional Software. Using the Library setting instead of Source. However, when I am trying to call a function from arm_math.h the compiler throws an error that it is not possible to find that function call.
Any ideas? How can I include CMSIS-DSP.
I am using GCC compiler and STMCubeIDE
Solved! Go to Solution.
2020-01-27 11:11 AM
I had the same issue with CubeMX 5.5.5, one has to check on this screen the CMSIS packages:
Then arm_math.h will appear:
You can compile then, but the linker will miss the libraries. Lost a lot of time and figured out, that it worked for me as follows:
Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:
Set the Path for libraries then:
And specify the library to be used - without extension!!!!:
Don't know, why I have to copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a, took a long time to figure out, which type of libray is the right (I have a STM32F4 - it looks like it's little endian, with FPU). Don't know why I have to specify the library name without an extions. But it seems to work now.
Would be fine, if CubeMX takes the decision and does all the work for me.
The documentation state is bad as well.
Or maybe, I'm just too stupid and/or missed any good document...
hth
Andy
2020-01-27 12:05 AM
Hello @OSala.1
Which cubeMX version did you use ?
Please try with the lasted version (5.5.0).
Best regards,
Nesrine
2020-01-27 11:11 AM
I had the same issue with CubeMX 5.5.5, one has to check on this screen the CMSIS packages:
Then arm_math.h will appear:
You can compile then, but the linker will miss the libraries. Lost a lot of time and figured out, that it worked for me as follows:
Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:
Set the Path for libraries then:
And specify the library to be used - without extension!!!!:
Don't know, why I have to copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a, took a long time to figure out, which type of libray is the right (I have a STM32F4 - it looks like it's little endian, with FPU). Don't know why I have to specify the library name without an extions. But it seems to work now.
Would be fine, if CubeMX takes the decision and does all the work for me.
The documentation state is bad as well.
Or maybe, I'm just too stupid and/or missed any good document...
hth
Andy
2020-01-28 07:54 AM
Hi @OSala.1
I'd like to add to Andy's helpful answer and suggest that you also check out this thread to make sure your libraries are valid:
https://www.avrfreaks.net/forum/problem-including-cmsis-dsp-library-atmel-studio-using-atsame54
Good luck.
2020-01-29 07:39 PM
Correction:
> Copy both arm_cortexM4lf_math.lib and libarm_cortexM4lf_math.a to a manually created subfolder:
It is sufficient to copy only libarm_cortexM4lf_math.a.
> And specify the library to be used - without extension!!!!:
Without extension and without the prefix 'lib', i.e. the file namend libarm_cortexM4lf_math.a has to be specified as libarm_cortexM4lf_math.a in the Path and Symbols dialog.
hth
Andy
P.S.: All this should be a nobrainer, if the CubeMX would work correctly :(
2020-01-30 02:58 AM
Thanks Andy! That worked well for me.
In older versions I had to manually add CMSIS DSP just like you stated, I thought that in this new CubeMX version they managed to do the work for the user...
2020-03-17 08:12 PM
I copied the libarm_cortexM4lf_math.a into a Lib folder inside my project directory.
And specified the library in the linker settings as shown in the picture below.
But I still get an error message saying that, the library was not found.
08:24:46 **** Incremental Build of configuration Debug for project CMSIS_DSP_PID_Test ****
make -j12 all
arm-none-eabi-gcc -o "CMSIS_DSP_PID_Test.elf" @"objects.list" -llibarm_cortexM4lf_math -mcpu=cortex-m4 -T"/home/sandhan/Projects/STM32CubeIDE/workspace_1.3.0/[Nucleo-64 STM32G474RE] Projects/CMSIS_DSP_PID_Test/STM32G474RETX_FLASH.ld" --specs=nosys.specs -Wl,-Map="CMSIS_DSP_PID_Test.map" -Wl,--gc-sections -static -L"/home/sandhan/Projects/STM32CubeIDE/workspace_1.3.0/[Nucleo-64 STM32G474RE] Projects/CMSIS_DSP_PID_Test/Middlewares/Third_Party/ARM_CMSIS/CMSIS/DSP/Lib" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
/opt/st/stm32cubeide_1.3.0/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.linux64_1.0.0.201904181610/tools/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: cannot find -llibarm_cortexM4lf_math
collect2: error: ld returned 1 exit status
make: *** [makefile:44: CMSIS_DSP_PID_Test.elf] Error 1
"make -j12 all" terminated with exit code 2. Build might be incomplete.
08:24:47 Build Failed. 1 errors, 0 warnings. (took 470ms)
2020-07-21 06:56 AM
Answer for me was given in this link. gnu linker adds the lib prefix. So without the lib starting in the name it worked for mer