cancel
Showing results for 
Search instead for 
Did you mean: 

"first defined here" error with CMSIS DSP 1.15 (STM32H750IBTx)

lehl
Associate II

Hello,

I am trying to use the newest cmsis dsp library (v1.15) to implement a vector matrix implementation. I am running into a "first defined here error" when trying to build with the cmsis dsp library (v1.15). I created an empty project just to try out building a project with the library included. I am running into the same issue there.

I am using STM32CubeIDE version 1.13.1 and an STM32H750 with an M7.

errormessage.JPG

If I understand correctly, CMSIS v 1.15 does not have a "lib" folder anymore like the older versions and only the Include, PrivateInclude and Source folders must be integrated. Therefore the instructions in Configuring DSP libraries on STM32CubeIDE - STMicroelectronics Community are not helpful to me.

Here you can see the folders I included. 

Am I missing something? How can I use the newest CMSIS library? I couldn't find any helpful documentation on the internet.

Thank you,

Leonard

IncludePaths.JPG

folderstructure.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
lehl
Associate II

Hi @KDJEM.1 

I found a solution to my problem. As I stated in my original question, it is necessary to include the CMSIS Source folder in the project, so the newest CMSIS version can be compiled.

Doing so results in a multiple definition error. The reason for this is, that the subfolders of "Source" have a ".c" file beginning with a capital letter (in the "BasicMathFunctions" folder it is "BasicMathFunctions.c" and BasicMathFunctionsF16.c").

cfiles.png

These files include ".c" files causing the multiple definition error on my system.

multipleDefinition.JPG

Excluding these ".c" files from my build fixed my issue. Solved: Re: Error including the CMSIS include files in the... - STMicroelectronics Community describes a similar problem to mine.

View solution in original post

5 REPLIES 5
KDJEM.1
ST Employee

Hello @lehl and welcome to the Community :),

These errors are the consequence of multiple definition.

The DSP folder must contain the include folders. Then add a new path in order to support header file as already described in Configuring DSP libraries on STM32CubeIDE - STMicroelectronics Community section 2. Including the DSP libraries and header files.

For that please remove "Source folder" in your project.

Please let me know if the issue is solved!

Thank you.

Kaouthar

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.

Hello @KDJEM.1 

Thank you for your fast response.

When I remove the "Source" folder, the project compiles without errors. As soon as I am using functions included in the arm_math.h I get an "undefined reference" error. 

errormessagewithoutsourcefolder.JPG

Here is the code in my main function. 

matrixfunction.JPG

A new path ist added to support the header files (as shown in my original post).

In the link you posted, there is a ".a" library file added. The lib folder is not available in the new cmsis version. I am not sure what "library" you mean, that I am supposed to include. This is the version I am trying to use ARM-software/CMSIS-DSP: CMSIS-DSP embedded compute library for Cortex-M and Cortex-A (github.com)

From my understanding, reading the documentation I thought the source folder is needed to compile the project.

Unfortunately, I cannot attach my project to this post. I uploaded it to wetransfer. You can view it with the following link: https://we.tl/t-6zw8hxkEY1

Thank you,

Leonard

KDJEM.1
ST Employee

Hi @lehl ,

Thank you for updating post.

It is note in this CMSIS-DSP library that, building other projects may require installation of other libraries (CMSIS), other tools (Arm Virtual Hardware) or CMSIS build tools.

STM32CubeIDE use GCC compiler, so you need to add "GCC" folder which is under "Lib" folder. For that, please copy "Lib" folder from <STM32Cube_Repository>\STM32Cube_FW_H7_V.1.11.1\Drivers\CMSIS and paste it under..\Drivers\CMSIS_DSP, then update libraries.

I hope this help you to solve the issue.

Thank you.

Kaouthar.

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.

lehl
Associate II

Hi @KDJEM.1 

Thank you for your help. This solved my issue.

Leonard

Edit:

Unfortunately your suggested solution did not solve my problem after all.

Building the project works and using functions such as "arm_mat_trans_f32" work when using the headerfiles of the newest CMSIS version. 

I tried to implement the vector matrix multiplication, that I intended to use the updated library for, as these functions are not included in older versions of CMSIS. When compiling I get a "undefined reference to 'arm_mat_vec_mult_f32' " error.

I have the assumption, that the library file in <STM32Cube_Repository>\STM32Cube_FW_H7_V.1.11.1\Drivers\CMSIS is of an older CMSIS version, that does not include vector matrix functions.

lehl
Associate II

Hi @KDJEM.1 

I found a solution to my problem. As I stated in my original question, it is necessary to include the CMSIS Source folder in the project, so the newest CMSIS version can be compiled.

Doing so results in a multiple definition error. The reason for this is, that the subfolders of "Source" have a ".c" file beginning with a capital letter (in the "BasicMathFunctions" folder it is "BasicMathFunctions.c" and BasicMathFunctionsF16.c").

cfiles.png

These files include ".c" files causing the multiple definition error on my system.

multipleDefinition.JPG

Excluding these ".c" files from my build fixed my issue. Solved: Re: Error including the CMSIS include files in the... - STMicroelectronics Community describes a similar problem to mine.