From e0c2384f56b6aaf2e53c6ce372618bf3f8106378 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk Date: Thu, 2 Nov 2023 07:55:25 +0100 Subject: [PATCH] Addressed review comments * Moved MINIMAL_LIBC config to mcuboot defaults * Brought back setting lock feature map, but changed the value from 0x101 to 0x181 (added COTA support) Additionally: * Changed main return type from void to main for Zephyr unit tests runner. --- config/nrfconnect/chip-module/Kconfig.mcuboot.defaults | 4 ++++ .../nrfconnect/child_image/mcuboot/prj_dfu.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_dfu.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- .../light-switch-app/nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../lock-app/nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- examples/lock-app/nrfconnect/main/ZclCallbacks.cpp | 4 ++++ examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../pump-app/nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- examples/window-app/nrfconnect/child_image/mcuboot/prj.conf | 3 --- .../nrfconnect/child_image/mcuboot/prj_release.conf | 3 --- src/test_driver/nrfconnect/main/runner.cpp | 2 +- 19 files changed, 9 insertions(+), 49 deletions(-) diff --git a/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults b/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults index 7047a9936a1fc5..31759beba22ffc 100644 --- a/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults +++ b/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults @@ -43,6 +43,10 @@ config FLASH config FPROTECT default y +choice LIBC_IMPLEMENTATION + default MINIMAL_LIBC +endchoice + # nRF7002DK uses SPI NOR external flash if BOARD_NRF7002DK_NRF5340_CPUAPP diff --git a/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_dfu.conf b/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_dfu.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_dfu.conf +++ b/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_dfu.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_release.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/all-clusters-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_dfu.conf b/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_dfu.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_dfu.conf +++ b/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_dfu.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_release.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/all-clusters-minimal-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj_release.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/light-switch-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/lighting-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/lighting-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/lighting-app/nrfconnect/child_image/mcuboot/prj_release.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/lighting-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/lighting-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/lock-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/lock-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/lock-app/nrfconnect/child_image/mcuboot/prj_release.conf index f4a29e9ccc1ed6..90969a32dbc414 100644 --- a/examples/lock-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/lock-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n CONFIG_GPIO=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp index b78a5278460cd0..99ea77ee21adb9 100644 --- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp @@ -126,5 +126,9 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) logOnFailure(DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER), "number of credentials per user"); + // Set FeatureMap to (kUser|kPinCredential), default is: + // (kUser|kAccessSchedules|kRfidCredential|kPinCredential) 0x113 + logOnFailure(DoorLock::Attributes::FeatureMap::Set(endpoint, 0x181), "feature map"); + AppTask::Instance().UpdateClusterState(BoltLockMgr().GetState(), BoltLockManager::OperationSource::kUnspecified); } diff --git a/examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/pump-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/pump-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/pump-app/nrfconnect/child_image/mcuboot/prj_release.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/pump-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/pump-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj_release.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/pump-controller-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/window-app/nrfconnect/child_image/mcuboot/prj.conf b/examples/window-app/nrfconnect/child_image/mcuboot/prj.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/window-app/nrfconnect/child_image/mcuboot/prj.conf +++ b/examples/window-app/nrfconnect/child_image/mcuboot/prj.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/examples/window-app/nrfconnect/child_image/mcuboot/prj_release.conf b/examples/window-app/nrfconnect/child_image/mcuboot/prj_release.conf index 03badfbdc67125..287c7829c6a5cf 100644 --- a/examples/window-app/nrfconnect/child_image/mcuboot/prj_release.conf +++ b/examples/window-app/nrfconnect/child_image/mcuboot/prj_release.conf @@ -28,6 +28,3 @@ CONFIG_CONSOLE=n CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_USE_SEGGER_RTT=n - -# Use minimal C library instead of the Picolib -CONFIG_MINIMAL_LIBC=y diff --git a/src/test_driver/nrfconnect/main/runner.cpp b/src/test_driver/nrfconnect/main/runner.cpp index 7cff68e0efcbc6..5c9a73ecba1968 100644 --- a/src/test_driver/nrfconnect/main/runner.cpp +++ b/src/test_driver/nrfconnect/main/runner.cpp @@ -27,7 +27,7 @@ using namespace ::chip::DeviceLayer; LOG_MODULE_REGISTER(runner, CONFIG_MATTER_LOG_LEVEL); -extern "C" void main(void) +extern "C" int main(void) { VerifyOrDie(settings_subsys_init() == 0);