pkg/cmsis-dsp: update to V5.4.0 from ARM repo

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
This commit is contained in:
Dylan Laduranty 2018-12-06 14:11:08 +01:00
parent fdcac731eb
commit 514812fc7c
8 changed files with 106 additions and 66 deletions

View File

@ -1,13 +1,12 @@
PKG_NAME=cmsis-dsp
PKG_URL=https://github.com/gebart/CMSIS-DSP.git
PKG_VERSION=v1.4.5a-riot2
PKG_LICENSE=BSD-3-Clause
CFLAGS += -Wno-strict-aliasing
PKG_URL=https://github.com/ARM-software/CMSIS_5
PKG_VERSION=5.4.0
PKG_LICENSE=Apache-2.0
CFLAGS += -Wno-strict-aliasing -Wno-unused-parameter
.PHONY: all
all: git-download
"$(MAKE)" -C $(PKG_BUILDDIR)
"$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.$(PKG_NAME)
include $(RIOTBASE)/pkg/pkg.mk

View File

@ -0,0 +1,43 @@
PKG_NAME=cmsis-dsp
# A list of all the directories to build for CMSIS-DSP
CMSIS_DIRS += \
CMSIS/DSP/Source/BasicMathFunctions \
CMSIS/DSP/Source/CommonTables \
CMSIS/DSP/Source/ComplexMathFunctions \
CMSIS/DSP/Source/ControllerFunctions \
CMSIS/DSP/Source/FastMathFunctions \
CMSIS/DSP/Source/FilteringFunctions \
CMSIS/DSP/Source/MatrixFunctions \
CMSIS/DSP/Source/StatisticsFunctions \
CMSIS/DSP/Source/SupportFunctions \
CMSIS/DSP/Source/TransformFunctions \
#
INCLUDES += -I$(CURDIR)/CMSIS/DSP/Include
CMSIS_BINDIRS = $(addprefix $(BINDIR)/$(PKG_NAME)/,$(CMSIS_DIRS))
# Override default RIOT search path for sources to include all of the CMSIS-DSP
# sources in one library instead of one library per subdirectory.
SRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.c))
SRCXX := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.cpp))
ASMSRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.s))
ASSMSRC := $(foreach DIR,$(CMSIS_DIRS),$(wildcard $(DIR)/*.S))
OBJC := $(SRC:%.c=$(BINDIR)/$(PKG_NAME)/%.o)
OBJCXX := $(SRCXX:%.cpp=$(BINDIR)/$(PKG_NAME)/%.o)
ASMOBJ := $(ASMSRC:%.s=$(BINDIR)/$(PKG_NAME)/%.o)
ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)/$(PKG_NAME)/%.o)
OBJ = $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ)
# Create subdirectories if they do not already exist
$(OBJ): | $(CMSIS_BINDIRS)
$(CMSIS_BINDIRS):
@mkdir -p $@
# Reset the default goal.
.DEFAULT_GOAL :=
# Include RIOT settings and recipes
include $(RIOTBASE)/Makefile.base

View File

@ -1 +1 @@
INCLUDES += -I$(PKGDIRBASE)/cmsis-dsp/include
INCLUDES += -I$(PKGDIRBASE)/cmsis-dsp/CMSIS/DSP/Include

View File

@ -1 +1,2 @@
Since there is no official public repository for the CMSIS-DSP library, we are using our own repo.
This package uses DSP ARM CMSIS header from the official
[ARM github repo](https://github.com/ARM-software/CMSIS_5)

View File

@ -0,0 +1,30 @@
From da78a3a713c2431f32685da0c28b574bfb93bd4b Mon Sep 17 00:00:00 2001
From: Martine Lenders <m.lenders@fu-berlin.de>
Date: Thu, 6 Dec 2018 14:09:00 +0100
Subject: [PATCH 1/2] [PATCH] arm_math: add clang branch for optimization
macros
---
CMSIS/DSP/Include/arm_math.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/CMSIS/DSP/Include/arm_math.h b/CMSIS/DSP/Include/arm_math.h
index ea9dd26a..6e4d9116 100644
--- a/CMSIS/DSP/Include/arm_math.h
+++ b/CMSIS/DSP/Include/arm_math.h
@@ -7074,6 +7074,12 @@ void arm_rfft_fast_f32(
#define IAR_ONLY_LOW_OPTIMIZATION_ENTER
#define IAR_ONLY_LOW_OPTIMIZATION_EXIT
+#elif defined(__clang__)
+ #define LOW_OPTIMIZATION_ENTER __attribute__(( optnone ))
+ #define LOW_OPTIMIZATION_EXIT
+ #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
+ #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
+
#elif defined ( __GNUC__ )
#define LOW_OPTIMIZATION_ENTER \
__attribute__(( optimize("-O1") ))
--
2.17.1

View File

@ -1,33 +0,0 @@
From 1d862f709c9da0d59e54ea5ff9eb7417b1db92a4 Mon Sep 17 00:00:00 2001
From: Martine Lenders <m.lenders@fu-berlin.de>
Date: Tue, 7 Aug 2018 12:34:16 +0200
Subject: [PATCH] arm_math: add clang branch for optimization macros
---
include/arm_math.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/arm_math.h b/include/arm_math.h
index e4b2f62..65973f6 100644
--- a/include/arm_math.h
+++ b/include/arm_math.h
@@ -7516,6 +7516,16 @@ void arm_rfft_fast_f32(
//Exit low optimization region - place directly after end of function definition
#define IAR_ONLY_LOW_OPTIMIZATION_EXIT
+#elif defined(__clang__)
+
+ #define LOW_OPTIMIZATION_ENTER __attribute__(( optnone ))
+
+ #define LOW_OPTIMIZATION_EXIT
+
+ #define IAR_ONLY_LOW_OPTIMIZATION_ENTER
+
+ #define IAR_ONLY_LOW_OPTIMIZATION_EXIT
+
#elif defined(__GNUC__)
#define LOW_OPTIMIZATION_ENTER __attribute__(( optimize("-O1") ))
--
2.7.4

View File

@ -1,25 +0,0 @@
From 53e086efc203ad8e1646524c732588d27aabfc53 Mon Sep 17 00:00:00 2001
From: Vincent Dupont <vincent@otakeys.com>
Date: Mon, 20 Feb 2017 19:00:08 +0100
Subject: [PATCH] include cpu_conf.h
---
include/arm_math.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/arm_math.h b/include/arm_math.h
index e4b2f62..cde16bf 100644
--- a/include/arm_math.h
+++ b/include/arm_math.h
@@ -288,6 +288,8 @@
#ifndef _ARM_MATH_H
#define _ARM_MATH_H
+#include "cpu_conf.h"
+
#define __CMSIS_GENERIC /* disable NVIC and Systick functions */
#if defined(ARM_MATH_CM7)
--
2.9.3

View File

@ -0,0 +1,25 @@
From fdd48d357dcf09933b3bee28b510386b7cb98b34 Mon Sep 17 00:00:00 2001
From: Vincent Dupont <vincent@otakeys.com>
Date: Tue, 15 Jan 2019 17:32:56 +0100
Subject: [PATCH 2/2] [PATCH] include cpu_conf.h
---
CMSIS/DSP/Include/arm_math.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/CMSIS/DSP/Include/arm_math.h b/CMSIS/DSP/Include/arm_math.h
index 6e4d9116..6af24bab 100644
--- a/CMSIS/DSP/Include/arm_math.h
+++ b/CMSIS/DSP/Include/arm_math.h
@@ -289,6 +289,8 @@
#ifndef _ARM_MATH_H
#define _ARM_MATH_H
+#include "cpu_conf.h"
+
/* Compiler specific diagnostic adjustment */
#if defined ( __CC_ARM )
--
2.17.1