From 252484e82ac3c2506288a9f2c9730bea338f52c4 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Tue, 26 Apr 2022 10:43:54 +0200 Subject: [PATCH 1/4] Kconfig: load application configuration first --- Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kconfig b/Kconfig index 935a7f61f6..2802ea4192 100644 --- a/Kconfig +++ b/Kconfig @@ -18,16 +18,16 @@ rsource "kconfigs/Kconfig.errors" # For now, get used modules as macros from this file (see kconfig.mk) osource "$(KCONFIG_GENERATED_DEPENDENCIES)" -# Load first board configurations, which might override CPU's +# Load first the application configuration, as it may declare symbols in priority +osource "$(APPDIR)/Kconfig" + +# Load board configurations, which might override CPU's orsource "$(BOARDDIR)/Kconfig" orsource "$(RIOTCPU)/$(CPU)/Kconfig" rsource "$(RIOTBOARD)/Kconfig" rsource "$(RIOTCPU)/Kconfig" -# The application may declare new symbols as well -osource "$(APPDIR)/Kconfig" - rsource "core/Kconfig" rsource "drivers/Kconfig" rsource "sys/Kconfig" From 628132a4e198a036c4cf4d88c03e089b8a93388f Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 22 Apr 2022 14:17:32 +0200 Subject: [PATCH 2/4] pkg: add Kconfig support for flatbuffers/ruy/tflite-micro --- pkg/Kconfig | 3 ++ pkg/flatbuffers/Kconfig | 15 +++++++++ pkg/gemmlowp/Kconfig | 5 --- pkg/ruy/Kconfig | 4 +++ pkg/ruy/Makefile.dep | 2 -- pkg/tflite-micro/Kconfig | 59 +++++++++++++++++++++++++++++++++++ pkg/tflite-micro/Makefile.dep | 1 - 7 files changed, 81 insertions(+), 8 deletions(-) create mode 100644 pkg/flatbuffers/Kconfig create mode 100644 pkg/tflite-micro/Kconfig diff --git a/pkg/Kconfig b/pkg/Kconfig index 2bd8352eb9..eb3abd2cb8 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -25,6 +25,7 @@ rsource "esp8266_sdk/Kconfig" rsource "etl/Kconfig" rsource "fff/Kconfig" rsource "fido2_tests/Kconfig" +rsource "flatbuffers/Kconfig" rsource "gecko_sdk/Kconfig" rsource "gemmlowp/Kconfig" rsource "hacl/Kconfig" @@ -51,8 +52,10 @@ rsource "qcbor/Kconfig" rsource "qdsa/Kconfig" rsource "qr-code-generator/Kconfig" rsource "relic/Kconfig" +rsource "ruy/Kconfig" rsource "semtech-loramac/Kconfig" rsource "talking_leds/Kconfig" +rsource "tflite-micro/Kconfig" rsource "tiny-asn1/Kconfig" rsource "tinycbor/Kconfig" rsource "tinycrypt/Kconfig" diff --git a/pkg/flatbuffers/Kconfig b/pkg/flatbuffers/Kconfig new file mode 100644 index 0000000000..55e682f08e --- /dev/null +++ b/pkg/flatbuffers/Kconfig @@ -0,0 +1,15 @@ +# Copyright (c) 2022 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config PACKAGE_FLATBUFFERS + bool "Flatbuffers package" + depends on TEST_KCONFIG + depends on HAS_CPP + depends on HAS_LIBSTDCPP + + select MODULE_LIBSTDCPP + select MODULE_CPP11-COMPAT diff --git a/pkg/gemmlowp/Kconfig b/pkg/gemmlowp/Kconfig index 377c441a62..066b88fccb 100644 --- a/pkg/gemmlowp/Kconfig +++ b/pkg/gemmlowp/Kconfig @@ -8,10 +8,5 @@ config PACKAGE_GEMMLOWP bool "General Matrix Multiplication package" depends on TEST_KCONFIG - select MODULE_GEMMLOWP help A small self-contained low-precision GEMM library. - -config MODULE_GEMMLOWP - bool - depends on TEST_KCONFIG diff --git a/pkg/ruy/Kconfig b/pkg/ruy/Kconfig index 1298c6d4f3..47d9564d2a 100644 --- a/pkg/ruy/Kconfig +++ b/pkg/ruy/Kconfig @@ -7,3 +7,7 @@ config PACKAGE_RUY bool "The ruy matrix multiplication library" depends on TEST_KCONFIG + depends on HAS_CPP + depends on HAS_LIBSTDCPP + + select MODULE_CPP11-COMPAT diff --git a/pkg/ruy/Makefile.dep b/pkg/ruy/Makefile.dep index cad3b908b7..5648689939 100644 --- a/pkg/ruy/Makefile.dep +++ b/pkg/ruy/Makefile.dep @@ -1,3 +1 @@ -FEATURES_REQUIRED += cpp - USEMODULE += cpp11-compat diff --git a/pkg/tflite-micro/Kconfig b/pkg/tflite-micro/Kconfig new file mode 100644 index 0000000000..a8ee67b1b4 --- /dev/null +++ b/pkg/tflite-micro/Kconfig @@ -0,0 +1,59 @@ +# Copyright (c) 2022 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config PACKAGE_TFLITE-MICRO + bool "TFlite Micro package" + depends on TEST_KCONFIG + depends on HAS_CPP + depends on HAS_LIBSTDCPP + depends on !HAS_ARCH_MIPS32R2 + depends on !HAS_ARCH_RISCV + + select MODULE_LIBSTDCPP + select MODULE_CPP11-COMPAT + + select PACKAGE_FLATBUFFERS + select PACKAGE_GEMMLOWP + select PACKAGE_RUY + + select MODULE_TFLITE-C + select MODULE_TFLITE-CORE-API + select MODULE_TFLITE-KERNELS + select MODULE_TFLITE-KERNELS-INTERNAL + select MODULE_TFLITE-KERNELS-INTERNAL-REFERENCE + select MODULE_TFLITE-MICRO + select MODULE_TFLITE-MICRO-KERNELS + select MODULE_TFLITE-MICRO-MEMORY-PLANNER + select MODULE_TFLITE-SCHEMA + + +config MODULE_TFLITE-C + bool + +config MODULE_TFLITE-CORE-API + bool + +config MODULE_TFLITE-KERNELS + bool + +config MODULE_TFLITE-KERNELS-INTERNAL + bool + +config MODULE_TFLITE-KERNELS-INTERNAL-REFERENCE + bool + +config MODULE_TFLITE-MICRO + bool + +config MODULE_TFLITE-MICRO-KERNELS + bool + +config MODULE_TFLITE-MICRO-MEMORY-PLANNER + bool + +config MODULE_TFLITE-SCHEMA + bool diff --git a/pkg/tflite-micro/Makefile.dep b/pkg/tflite-micro/Makefile.dep index e2fa8f5d43..673d909a65 100644 --- a/pkg/tflite-micro/Makefile.dep +++ b/pkg/tflite-micro/Makefile.dep @@ -1,4 +1,3 @@ -FEATURES_REQUIRED += cpp USEMODULE += cpp11-compat USEPKG += flatbuffers From 5833956daf4cc8535ae9d7e8b561ac726a52b908 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 22 Apr 2022 14:17:48 +0200 Subject: [PATCH 3/4] tests/pkg_flatbuffers: add Kconfig support --- tests/pkg_flatbuffers/app.config.test | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/pkg_flatbuffers/app.config.test diff --git a/tests/pkg_flatbuffers/app.config.test b/tests/pkg_flatbuffers/app.config.test new file mode 100644 index 0000000000..26bb4bfe0c --- /dev/null +++ b/tests/pkg_flatbuffers/app.config.test @@ -0,0 +1 @@ +CONFIG_PACKAGE_FLATBUFFERS=y From 7577e4bf471e6dc9442db29f8340e10126d1cf96 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 22 Apr 2022 14:18:03 +0200 Subject: [PATCH 4/4] tests/pkg_tflite-micro: add Kconfig support --- tests/pkg_tflite-micro/Kconfig | 6 ++++++ tests/pkg_tflite-micro/Makefile | 4 ++++ tests/pkg_tflite-micro/app.config.test | 2 ++ tests/pkg_tflite-micro/external_modules/mnist/Kconfig | 10 ++++++++++ 4 files changed, 22 insertions(+) create mode 100644 tests/pkg_tflite-micro/Kconfig create mode 100644 tests/pkg_tflite-micro/app.config.test create mode 100644 tests/pkg_tflite-micro/external_modules/mnist/Kconfig diff --git a/tests/pkg_tflite-micro/Kconfig b/tests/pkg_tflite-micro/Kconfig new file mode 100644 index 0000000000..d9004558a5 --- /dev/null +++ b/tests/pkg_tflite-micro/Kconfig @@ -0,0 +1,6 @@ +config MODULE_CORTEXM_FPU + bool + default n + depends on TEST_KCONFIG + depends on CPU_CORE_CORTEX_M + depends on HAS_CORTEXM_FPU diff --git a/tests/pkg_tflite-micro/Makefile b/tests/pkg_tflite-micro/Makefile index eec183604c..a5c30fe016 100644 --- a/tests/pkg_tflite-micro/Makefile +++ b/tests/pkg_tflite-micro/Makefile @@ -11,4 +11,8 @@ DISABLE_MODULE += cortexm_fpu USEMODULE += mnist EXTERNAL_MODULE_DIRS += external_modules +# As there is an 'Kconfig' we want to explicitly disable Kconfig by setting +# the variable to empty +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/pkg_tflite-micro/app.config.test b/tests/pkg_tflite-micro/app.config.test new file mode 100644 index 0000000000..4798ff9937 --- /dev/null +++ b/tests/pkg_tflite-micro/app.config.test @@ -0,0 +1,2 @@ +CONFIG_PACKAGE_TFLITE-MICRO=y +CONFIG_MODULE_MNIST=y diff --git a/tests/pkg_tflite-micro/external_modules/mnist/Kconfig b/tests/pkg_tflite-micro/external_modules/mnist/Kconfig new file mode 100644 index 0000000000..c50b13a974 --- /dev/null +++ b/tests/pkg_tflite-micro/external_modules/mnist/Kconfig @@ -0,0 +1,10 @@ +# Copyright (c) 2022 Inria +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_MNIST + bool "MNIST main functions" + depends on TEST_KCONFIG