Using CMSIS DSP

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
elagil
Posts: 94
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

Using CMSIS DSP

Post by elagil »

Hello!

I want to use the CMSIS DSP libraries with my STM32F746.

Therefore, I got CMSIS 5 from git and included it with a custom cmsis.mk:

Code: Select all

DSP_ROOT := ./../cmsis/CMSIS/DSP

# List of the CMSIS DSP files
CMSISDSPSRC = ${DSP_ROOT}/Source/$(wildcard */*.c)
CMSISDSPINC = ${DSP_ROOT}/Include ${DSP_ROOT}/Include/dsp

# Shared variables
ALLCSRC += $(CMSISDSPSRC)
ALLINC  += $(CMSISDSPINC)


I include the above file in my main makefile with

Code: Select all

include ./cmsis.mk


The functions are then found in my code, but I get compiler warnings:

Code: Select all

./../cmsis/CMSIS/DSP/Include/arm_math_types.h:102:5: warning: "__ARM_FEATURE_MVE" is not defined [-Wundef]
 #if __ARM_FEATURE_MVE


I assume that I need to tell CMSIS about the feature set of my processor. What is the best way to do it? Is something like this already defined in ChibiOs?

Thanks in advance!
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Using CMSIS DSP

Post by Giovanni »

Hi,

If I remember well that macro has to be defined by the compiler, you need to use the latest ARM GCC. What version are you using? you may also try to define that macro to zero in the makefile.

Giovanni
elagil
Posts: 94
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

Re: Using CMSIS DSP

Post by elagil »

Thank you!

Indeed, I was using an old 2016 version of the compiler, due to that bug with STM32F0 series parts.

Switching to the latest 2020 compiler does not define these values either, however the warning changes to

Code: Select all

warning: "__ARM_FEATURE_MVE" is not defined, evaluates to 0 [-Wundef]


I may define it manually then.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Using CMSIS DSP

Post by Giovanni »

Note that the latest compiler 9.3.1 fixed the problem with M0 cores, it is safe to use.

Giovanni
elagil
Posts: 94
Joined: Tue Sep 19, 2017 7:38 am
Has thanked: 8 times
Been thanked: 7 times

Re: Using CMSIS DSP

Post by elagil »

That is great to hear, I will use it then.
Post Reply