STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

orc2176
Posts: 1
Joined: Tue Mar 27, 2018 8:32 am

STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby orc2176 » Tue Mar 27, 2018 8:57 am

Dear Forum,
I am new with atollic truestudio and with stm32F4 and CubeMX. Now I am testing the DSP functions of the Chip STM32F4xx. Therefore I plan to use functions from arm_math.h. However when I compile my code the message appears:

undefined reference to 'x ', where x ist the name of a function from arm_math.h

I guess, the CMIS Lib which is associated with arm_math.h is missed. My Question:

What is the name of the lib?
Where I can get the official lib?
What about litte endian and big endian? It seems there are different libs.
Where the Lib should be located typically? In TrueStudio Path oder in my Workspace Path?
Do I have to add some Pathes and Lib Names in: Project Properties --> C/c++ Builders -->Settings-->C Linker-->Libraries-->Path and Name?
Is there something like: ignore prefix "lib" and ".a" at the end of the lib's name?

Sorry for my cloudy questions, I found different infos in the internet, so I am not shure, if I am on the right track.

I think, some other people in the internet had the same question, so an answer in the atollic board would be helpful for all.

Thanks, orc2176

treecatt
Posts: 39
Joined: Mon Jul 24, 2017 6:56 am

Re: STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby treecatt » Wed Mar 28, 2018 8:08 am

Did you create your project using STM32CodeMX?

Just as a test I created a project for my NUCLEO-STM32F207ZG board using STM32CubeMX. The math related header files were copied by STM32CubeMX to the project Drivers/CMSIS/Include folder already. To test the math functions I copied the sin/cos example file from the STM32CubeMX repository to my project source folder.

C:\STM32Cube\Repository\STM32Cube_FW_F2_V1.7.0\Drivers\CMSIS\DSP_Lib\Examples\arm_sin_cos_example\ARM

When I compiled the program I received an error msg from arm_math.h.

#error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS or
ARM_MATH_CM0")

This identified the need to add "ARM_MATH_CM3" to the project SYMBOLS which I did. I also had to manually copy the required DSP_Lib source code files to my project directory. Do not copy all the files. There are variants of the files which redefine the same function which will cause massive errors when compiling. The sin/cos example file used the f32 functions so I copied only the xxx_f32.c files. I changed the name of the main() function in arm_sin_cos_example_f32.c then added a function prototype in my main.c file. Added line to main.c to call the renamed function. Compiled successfully and executed the program without problem.

phoenix2000
Posts: 15
Joined: Sun Aug 12, 2018 11:02 am

Re: STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby phoenix2000 » Sun Aug 12, 2018 11:17 am

Hi
I had the same problem.
I defined ARM_MATH_CM4 by going to properties -> c/c++ general -> Paths and symbols ->Symbols.
All of the errors gone but now I have this error:
"
Description Resource Path Location Type
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" core_cm4.h /myDiscoveyProjects/Drivers/CMSIS/Include line 153 C/C++ Problem
"
Then I checked the __FPU_PRESENT definition which is defined as 1.
But why do I still get this error?

treecatt
Posts: 39
Joined: Mon Jul 24, 2017 6:56 am

Re: STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby treecatt » Sun Aug 12, 2018 9:28 pm

What device do you have selected?

Lawrence
Posts: 63
Joined: Mon Nov 09, 2015 5:13 pm

Re: STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby Lawrence » Mon Aug 13, 2018 2:41 am

Treecat might be on to something, not every stm42f4 has floating hardware.

They are the "M4F" cores.

I am also interrested in this.

phoenix2000
Posts: 15
Joined: Sun Aug 12, 2018 11:02 am

Re: STM32: how to use DSP Functions in Atollic, where is the appropriate CMIS Lib?

Postby phoenix2000 » Mon Aug 13, 2018 4:03 am

I'm using stm32f429 discovery board, which as I know has FPU.
//******************
Update:
Now It is OK, but the point is I don't know why :roll:
Let me explain the whole story, maybe you can get it.
Yesterday after that I got disappointed with hardware FPU, in properties -> c/c++ Build-> Setting I changed the assembler, c compiler, and linker target to use the software implementation of floating point. But even this gave me some error which seems they were related to FreeRTOS.
Anyway, I decided to check the hardware implementation again, so I changed it in setting again, But the result is without any error.
Maybe it's funny and not related but there is also another thing that I did.
Yesterday after that I created the project via CubeMX I clicked on the open project. But today after watching this:
https://www.youtube.com/watch?v=q9Ssi9ry1eg
I decided to delete the imported project from truestudio and import it as the above clip did.


Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: No registered users and 1 guest