From e309fcd695f63e222f425b8d74a51faaafba36ba Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Fri, 3 Nov 2023 14:56:15 +0100 Subject: [PATCH] [nrfconnect] Updated nRF Connect SDK to 2.5.0 (#30118) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [nrfconnect] Pushed downstream patches to align with v2.5.0 Pushed all downstream patches aligning nrfconnect platform to the nRF Connect SDK 2.5.0 version: * Added support for new Wi-Fi dongle board. Added enabling Wi-Fi support in Matter if nRF7002 EB is selected as a shield. Signed-off-by: Kamil Kasperczyk * Turn off wpa_supplicant debug output. This saves ~20kB of FLASH. Signed-off-by: Marcin Kajor * [nrfconnect] Enable zcbor explicitly for mcuboot Mcuboot requires zcbor, so enable it explicitly, otherwise the build fails with latest mcuboot. Signed-off-by: Robert Lubos * [nrfconnect] Align with the upstream net_if API change net_if_ipv6_maddr_join() now requires to provide a net_if pointer. Signed-off-by: Robert Lubos * config: nrfconnect: Remove PSA_WANT default n setting With PSA_WANT configurations being default n then these default values are no longer needed for chip-module. Signed-off-by: Joakim Andersson * [zephyr] Add config to enable watermarks support Added a config to control enabling support for heap watermarks within the Zephyr platform. * Fixed Wi-Fi re-connection mechanism. Do not force the Disconnect() if the wpa_supplicant recovered the connection by itself. Signed-off-by: Marcin Kajor * Disabled BLE GATT caching This commit disables BLE Gatt caching for nRF Connect SDK platform. Signed-off-by: Duda, Łukasz * Enabled erasing NVS as default method This commit configures FW to erase flash pages occupied by non-volatile storage when a factory reset is requested, instead of removing Matter-related settings only. Signed-off-by: Duda, Łukasz * Disable shell for OpenThread and HWINFO module This commit reduces the overall memory consumption by disabling the OpenThread shell and HWInfo module. Signed-off-by: Duda, Łukasz * Align finding Python3 executable to NCS requirements. We should try to find Python3 instead of Python within cmake scripts. * Enable Generating Onboarding Codes by default This PR enables automatic generation of onboarding codes to the build directory when Factory Data feature is enabled. * Enable minimal configuration of Shell Enable minimal shell configuration to save some ROM and RAM. Signed-off-by: Łukasz Duda * Fixed boot reason for nRF52 Recently the mechanism of nRF52 reboot type retention which is used in Matter has been deprecated in Zephyr and can be only bring back by a dedicated KConfig. Another solution (chosen) is to explicitly store boot reason in the retention registers for both nRF52 and nRF53. Signed-off-by: Marcin Kajor * Increased number of net sockets poll max Increased CONFIG_NET_SOCKETS_POLL_MAX from 4 to 6, as otherwise it resulted in bus fault during connection. Signed-off-by: Kamil Kasperczyk * Remove recovery mechanism for Wi-Fi connection Currently, the Wi-Fi driver supports the recovery mechanism and it seems that it works properly so we can remove our recovery mechanism when the connection is lost. Apart from losing the network, we need to leave the recovery mechanism to work after the device's reboot because we need to scan periodically to find a known network. * Increase the maximum number of prefixes to match the maximum number of IPv6 addresses per interface. Zephyr ipv6_nbr implementation requires the given address to have a matching prefix set on the interface. Otherwise, the default router is used for sending neighbor advertisement and as a result, in case there are multiple routers in the network, the packet can be sent to the invalid interface (not the one which issued neighbor solicitation). Signed-off-by: Marcin Kajor * [nrfconnect] Enable NVS lookup cache settings optimization By default, use the lookup cache hash function optimized for NVS used as the settings backend. This assumes that a user application uses Zephyr settings API and does not write to the NVS directly. * Disable nRF70 driver logs verbosity by default. This aims to keep memory footprint after this config is enabled by default in NCS. Signed-off-by: Marcin Kajor * Disabled BLE 2M PHY due to interoperability issues There were some interoperability issues discovered due to BLE PHY dynamic changes from 1M to 2M. The 2M was disabled to ensure the interoperability with some of the BT controllers. Signed-off-by: Kamil Kasperczyk * Disabled Wi-Fi logs to save flash Recently some new Wi-Fi logs were enabled by default. These need to be disabled to decrease memory footprint. Signed-off-by: Kamil Kasperczyk * [nrfconnect] Fixed door lock feature map Door lock sample has incorrect feature map value, because it is hardcoded in cpp file, instead of using the value generated from the .zap file. * [nrfconnect] Fixed window covering attributes default values Implemented post cluster init callback to set null values to 0, if any other value was not saved in NVS. * [nrfconnect] Disabled BOOT BANNER for release configuration * Align codebase with the new callback format Align NCS codebase with the new struct mgmt_callback format. * Restore IPC thread priority in Matter samples We noticed that IPC priority on nRF5340 is not set by default. We need to set it in DTS to be sure that the IPC thread does not collide with other threads. * Enable build with the factory data support. This PR enables factory data generation and usage by default in all NCS Matter samples. * Fix missing mcumgr header Header img_mgmt.h added to source file. * Forced using minimal libc for mcuboot image Minimal libc selection has to be forced for all Matter-related mcuboot builds. Otherwise the picolib is enabled and image size increases by several k, so it cannot fit in the dedicated partition. * Add bootutil for image definitions Adds building bootutil, when DFU with MCUmgr is enabled, for application image definitions. * [zephyr] Track number of enqueued platform events Add a new system statistic for tracking the number of enqueued platform events and update it in Zephyr platform. Signed-off-by: Damian Krolik * Optimize RAM usage - Reduce number of network buffers and packets This commit reduces the number of network buffers and packets used by the nrfconnect platform. - Add support for printing mbedTLS heap This commit adds support for printing the peak usage of mbedTLS heap. - Reduce number of Matter stack packet buffers This commit reduced the number of available Matter's packet buffers to 8 which affects RAM usage. - Introduce KConfig option to enable RAM profiling This commit introduces the KConfig option that enables a set of features useful for profiling the RAM memory. - Disable SSL server support for Matter This commit dissables unused support for SSL server. - Reduce size of platform event queue This commit overwrites the default size of platform event queue and sets it to 64. - Reduce mbedTLS heap and OpenThread stack sizes This commit reduces the mbedTLs heap and OpenThread stack sizes when Joiner role is enabled by not used (case of OT libraries). - Reduce kernel heap size for Matter over Wi-Fi This commit aligns the default heap size to the value used in the Shell example. - Optimize buffer usage of nRF700X driver for Matter Matter device does not need to operate as high-performance STA, and so this commit reduces the default number of buffers. As a result the heap used by the supplicant may be significantly reduced. - Added the missing conditions to HEAP configs. Decrease stack sizes according to the peak results Signed-off-by: Łukasz Duda Signed-off-by: Arkadiusz Balys * Increase stability of Wi-Fi LPM operations This commit increases number of TX Tokens to the previous value of 10 to prevent RPU stalls. Additionally it was observed that 500ms delay before executing factory reset is too small for certain situations on Wi-Fi. This commit also increases this delay to 1s. Signed-off-by: Łukasz Duda * [openthread] Aligned to CSL method API changes With the most recent OpenThread version, the API for CSL methods changed, so it had to be aligned in the Matter SDK. Added alternative implementation depending on the OpenThread API version. * [nrfconnect] Updated nRF Connect SDK to 2.5.0 Updated nRF Connect SDK version to 2.5.0 and updated all docker images version to the 24. * Restyled by whitespace * Restyled by clang-format * [shell] Fixed wrong condition for mbedtls include Changed if defined() to if statement to fix missing mbedtls header file for platforms using CHIP_CRYPTO_MBEDTLS = false * [nrfconnect] Disabled factory data for all clusters app The default prj.conf build does not use partition layout with factory data partition included, so the factory data support has to be disabled. * 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 fixed Zephyr unit tests: * Changed main return type from void to main for Zephyr unit tests runner. * Added decreasing pool size conditionally to not affect tests * Fixed exiting the tests to prevent abort. --------- Signed-off-by: Łukasz Duda Co-authored-by: Restyled.io --- .github/workflows/bloat_check.yaml | 2 +- .github/workflows/build.yaml | 10 +- .github/workflows/chef.yaml | 8 +- .github/workflows/cirque.yaml | 2 +- .github/workflows/doxygen.yaml | 2 +- .github/workflows/examples-ameba.yaml | 2 +- .github/workflows/examples-asr.yaml | 2 +- .github/workflows/examples-bouffalolab.yaml | 2 +- .../workflows/examples-cc13x2x7_26x2x7.yaml | 2 +- .github/workflows/examples-cc32xx.yaml | 2 +- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/examples-esp32.yaml | 4 +- .github/workflows/examples-infineon.yaml | 2 +- .github/workflows/examples-k32w.yaml | 2 +- .github/workflows/examples-linux-arm.yaml | 2 +- .github/workflows/examples-linux-imx.yaml | 2 +- .../workflows/examples-linux-standalone.yaml | 2 +- .github/workflows/examples-mbed.yaml | 2 +- .github/workflows/examples-mw320.yaml | 2 +- .github/workflows/examples-nrfconnect.yaml | 2 +- .github/workflows/examples-openiotsdk.yaml | 2 +- .github/workflows/examples-qpg.yaml | 2 +- .github/workflows/examples-stm32.yaml | 2 +- .github/workflows/examples-telink.yaml | 2 +- .github/workflows/examples-tizen.yaml | 2 +- .github/workflows/full-android.yaml | 2 +- .github/workflows/fuzzing-build.yaml | 2 +- .github/workflows/java-tests.yaml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/minimal-build.yaml | 2 +- .github/workflows/qemu.yaml | 4 +- .github/workflows/release_artifacts.yaml | 4 +- .github/workflows/smoketest-android.yaml | 2 +- .github/workflows/tests.yaml | 4 +- .github/workflows/unit_integration_test.yaml | 2 +- .github/workflows/zap_regeneration.yaml | 2 +- .github/workflows/zap_templates.yaml | 2 +- .../.nrfconnect-recommended-revision | 2 +- config/nrfconnect/chip-module/Kconfig | 26 +++- .../nrfconnect/chip-module/Kconfig.defaults | 114 ++++++++++------- .../nrfconnect/chip-module/Kconfig.features | 18 ++- .../chip-module/Kconfig.hci_rpmsg.defaults | 4 + .../chip-module/Kconfig.mcuboot.defaults | 7 ++ .../Kconfig.multiprotocol_rpmsg.defaults | 4 + .../chip-module/generate_factory_data.cmake | 2 +- config/zephyr/Kconfig | 6 + examples/all-clusters-app/ameba/README.md | 4 +- .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../boards/nrf7002dk_nrf5340_cpuapp.overlay | 7 ++ .../all-clusters-app/nrfconnect/prj_dfu.conf | 4 + .../nrfconnect/prj_release.conf | 5 + .../all-clusters-minimal-app/ameba/README.md | 4 +- .../nrfconnect/prj.conf | 4 + .../nrfconnect/prj_release.conf | 5 + examples/light-switch-app/ameba/README.md | 4 +- .../nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../boards/nrf7002dk_nrf5340_cpuapp.overlay | 7 ++ examples/light-switch-app/nrfconnect/prj.conf | 4 + .../nrfconnect/prj_release.conf | 5 + examples/lighting-app/ameba/README.md | 4 +- .../lighting-app/nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../boards/nrf7002dk_nrf5340_cpuapp.overlay | 7 ++ examples/lighting-app/nrfconnect/prj.conf | 4 + .../lighting-app/nrfconnect/prj_release.conf | 5 + examples/lock-app/nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../boards/nrf7002dk_nrf5340_cpuapp.overlay | 7 ++ .../lock-app/nrfconnect/main/ZclCallbacks.cpp | 2 +- examples/lock-app/nrfconnect/prj.conf | 4 + examples/lock-app/nrfconnect/prj_release.conf | 5 + examples/ota-requestor-app/ameba/README.md | 4 +- examples/pigweed-app/ameba/README.md | 4 +- .../platform/nrfconnect/util/DFUOverSMP.cpp | 11 +- examples/pump-app/nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ examples/pump-app/nrfconnect/prj.conf | 4 + examples/pump-app/nrfconnect/prj_release.conf | 5 + .../nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../pump-controller-app/nrfconnect/prj.conf | 4 + .../nrfconnect/prj_release.conf | 5 + examples/window-app/nrfconnect/CMakeLists.txt | 1 + .../boards/nrf5340dk_nrf5340_cpuapp.overlay | 7 ++ .../nrfconnect/main/ZclCallbacks.cpp | 55 ++++++++ examples/window-app/nrfconnect/prj.conf | 4 + .../window-app/nrfconnect/prj_release.conf | 5 + integrations/cloudbuild/build-all.yaml | 6 +- integrations/cloudbuild/chef.yaml | 6 +- integrations/cloudbuild/smoke-test.yaml | 14 +-- scripts/build/builders/nrf.py | 2 +- scripts/examples/nrfconnect_example.sh | 2 +- .../GenericPlatformManagerImpl_Zephyr.ipp | 6 + src/lib/shell/commands/Stat.cpp | 21 ++++ ...nericThreadStackManagerImpl_OpenThread.hpp | 17 ++- .../Zephyr/DiagnosticDataProviderImpl.cpp | 6 +- .../nrfconnect/CHIPDevicePlatformConfig.h | 4 +- src/platform/nrfconnect/Reboot.cpp | 6 - .../nrfconnect/SystemPlatformConfig.h | 4 + .../nrfconnect/wifi/NrfWiFiDriver.cpp | 4 - src/platform/nrfconnect/wifi/WiFiManager.cpp | 119 +++++------------- src/platform/nrfconnect/wifi/WiFiManager.h | 13 +- src/system/SystemStats.cpp | 1 + src/system/SystemStats.h | 1 + src/test_driver/nrfconnect/main/runner.cpp | 6 +- src/test_driver/tizen/README.md | 4 +- 107 files changed, 515 insertions(+), 253 deletions(-) diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index 2a1dee179aa3e0..36908d97d06385 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 588ded31e8cbf9..1fdec87ac8a696 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -135,7 +135,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -283,7 +283,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -343,7 +343,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --sysctl "net.ipv6.conf.all.disable_ipv6=0 @@ -451,7 +451,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 2b5b34478b677f..e1de11ca0becb1 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 options: --user root steps: @@ -54,7 +54,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:22 + image: ghcr.io/project-chip/chip-build-esp32:24 options: --user root steps: @@ -75,7 +75,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:22 + image: ghcr.io/project-chip/chip-build-nrf-platform:24 options: --user root steps: @@ -96,7 +96,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:22 + image: ghcr.io/project-chip/chip-build-telink:24 options: --user root steps: diff --git a/.github/workflows/cirque.yaml b/.github/workflows/cirque.yaml index c19e1dd911755c..5338ed27e4c2fe 100644 --- a/.github/workflows/cirque.yaml +++ b/.github/workflows/cirque.yaml @@ -40,7 +40,7 @@ jobs: # need to run with privilege, which isn't supported by job.XXX.contaner # https://github.com/actions/container-action/issues/2 # container: - # image: ghcr.io/project-chip/chip-build-cirque:22 + # image: ghcr.io/project-chip/chip-build-cirque:24 # volumes: # - "/tmp:/tmp" # - "/dev/pts:/dev/pts" diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 4e4e2abf319891..0480d013741b85 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:22 + image: ghcr.io/project-chip/chip-build-doxygen:24 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index 42afb3ee37b1e7..95ed4e23999c76 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:22 + image: ghcr.io/project-chip/chip-build-ameba:24 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 7bb7e790595f10..93c26450b01c85 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:22 + image: ghcr.io/project-chip/chip-build-asr:24 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index 53a43c267251c6..e0aa45bf677c50 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:22 + image: ghcr.io/project-chip/chip-build-bouffalolab:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13x2x7_26x2x7.yaml b/.github/workflows/examples-cc13x2x7_26x2x7.yaml index 4229f9800f2df8..ea90b8729766f9 100644 --- a/.github/workflows/examples-cc13x2x7_26x2x7.yaml +++ b/.github/workflows/examples-cc13x2x7_26x2x7.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:22 + image: ghcr.io/project-chip/chip-build-ti:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index 5a77c801447b6e..f45559e5d173f2 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:22 + image: ghcr.io/project-chip/chip-build-ti:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 899ac288dc1c70..c4d29e501a62c7 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:22 + image: ghcr.io/project-chip/chip-build-efr32:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index f1b8ff3b6f20a7..111c28ccfd2d10 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:22 + image: ghcr.io/project-chip/chip-build-esp32:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -130,7 +130,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:22 + image: ghcr.io/project-chip/chip-build-esp32:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index 7fc006fe8f6698..f225a4fba5867f 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:22 + image: ghcr.io/project-chip/chip-build-infineon:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-k32w.yaml b/.github/workflows/examples-k32w.yaml index 541106d618e2d5..58e366b6cfeca5 100644 --- a/.github/workflows/examples-k32w.yaml +++ b/.github/workflows/examples-k32w.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-k32w:22 + image: ghcr.io/project-chip/chip-build-k32w:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 4645b4e897d3ff..4ef5edd01cc5ce 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:22 + image: ghcr.io/project-chip/chip-build-crosscompile:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index e34148a8ff0a91..d64409d1146a66 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:22 + image: ghcr.io/project-chip/chip-build-imx:24 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index 8661b99d253b5f..98061009dc4fd9 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mbed.yaml b/.github/workflows/examples-mbed.yaml index a73d825ee444e8..9863d8f3f89703 100644 --- a/.github/workflows/examples-mbed.yaml +++ b/.github/workflows/examples-mbed.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-mbed-os:22 + image: ghcr.io/project-chip/chip-build-mbed-os:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index b5658efdcdf687..233a6f4fe9d540 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index b1cf4cd87279f3..3c22eaa79a0825 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:22 + image: ghcr.io/project-chip/chip-build-nrf-platform:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index de63249ee89d6a..5dc15c4ca2ec62 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:22 + image: ghcr.io/project-chip/chip-build-openiotsdk:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index 3590b33a7c6829..0f950134d2ff45 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index dce5de01d786d9..8f59b06aa50e4e 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index 225ddf16fd190b..994d6b5d78a325 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:22 + image: ghcr.io/project-chip/chip-build-telink:24 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index f6ca3bb793dc87..f01153240ffac6 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -34,7 +34,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:22 + image: ghcr.io/project-chip/chip-build-tizen:24 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index a227bdd6e16d08..20ba8990ed93f0 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:22 + image: ghcr.io/project-chip/chip-build-android:24 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 21ae6619fe0e73..adbe225b88fe4c 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index fe27fe9cdd4eb1..9cd1dea0447d04 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -40,7 +40,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:22 + image: ghcr.io/project-chip/chip-build-java:24 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index cc53e3ced79ac1..9db99f6461f459 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 steps: - name: Checkout diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index 269692c1461410..ff520e9e308fca 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:22 + image: ghcr.io/project-chip/chip-build-minimal:24 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index ac677a83d61468..6a61aa520f6ce4 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:22 + image: ghcr.io/project-chip/chip-build-esp32-qemu:24 volumes: - "/tmp/log_output:/tmp/test_logs" @@ -76,7 +76,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen-qemu:22 + image: ghcr.io/project-chip/chip-build-tizen-qemu:24 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index 9baca19da32835..dbe98f9666f6a6 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:22 + image: ghcr.io/project-chip/chip-build-esp32:24 steps: - name: Checkout @@ -68,7 +68,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:22 + image: ghcr.io/project-chip/chip-build-efr32:24 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index ee0fe3400830ab..2ff570884f3a1c 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:22 + image: ghcr.io/project-chip/chip-build-android:24 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fbc2cff25cd8f1..d610edef1dc623 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -404,7 +404,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index 75fcb2d062f456..e3c39f21438aec 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 volumes: - "/tmp/log_output:/tmp/test_logs" options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index 8ccd058de07b87..68b8782f576a43 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index a83069e9468d28..bf1e305c4c9d51 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:22 + image: ghcr.io/project-chip/chip-build:24 defaults: run: shell: sh diff --git a/config/nrfconnect/.nrfconnect-recommended-revision b/config/nrfconnect/.nrfconnect-recommended-revision index 8721bbc46ad2f7..21222ceed22ae6 100644 --- a/config/nrfconnect/.nrfconnect-recommended-revision +++ b/config/nrfconnect/.nrfconnect-recommended-revision @@ -1 +1 @@ -v2.4.0 +v2.5.0 diff --git a/config/nrfconnect/chip-module/Kconfig b/config/nrfconnect/chip-module/Kconfig index 95e49ac59e0262..33528638670917 100644 --- a/config/nrfconnect/chip-module/Kconfig +++ b/config/nrfconnect/chip-module/Kconfig @@ -16,6 +16,10 @@ rsource "../../zephyr/Kconfig" +config CHIP + imply NVS_LOOKUP_CACHE + imply NVS_LOOKUP_CACHE_FOR_SETTINGS + if CHIP config CHIP_NRF_PLATFORM @@ -119,7 +123,6 @@ config CHIP_FACTORY_DATA_CUSTOM_BACKEND config CHIP_FACTORY_DATA_BUILD bool "Generate factory data contents" - default n help Enables generation of the factory data contents during the building. This option requires the factory_data partition in Partition Manager @@ -170,6 +173,7 @@ config CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE config CHIP_FACTORY_DATA_GENERATE_ONBOARDING_CODES bool "Generate onboarding codes during the generation of a factory data set" + default y help Enables generation of onboarding codes (manual pairing code and QR code) during the generation of a factory data set. You can provide the @@ -220,7 +224,8 @@ config CHIP_FACTORY_DATA_USER_CERTS_PAI_CERT string "Path to the PAI certificate (DER format)" help Provides the absolute path to the PAI certificate in the DER format. -endif + +endif # CHIP_FACTORY_DATA_CERT_SOURCE_USER # Configs for SPAKE2+ generation config CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER @@ -235,14 +240,12 @@ config CHIP_DEVICE_GENERATE_ROTATING_DEVICE_UID help Enables the generation of a random Rotating device ID unique ID. -endif #CHIP_FACTORY_DATA_BUILD +endif # CHIP_FACTORY_DATA_BUILD # See config/zephyr/Kconfig for full definition config CHIP_FACTORY_RESET_ERASE_NVS bool - default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND - -endif + default y config CHIP_LOG_SIZE_OPTIMIZATION bool "Disable some detailed logs to decrease flash usage" @@ -260,3 +263,14 @@ config CHIP_IPV4 If disabled, it allows to build nRF Connect SDK application with IPv4 support independently of the Matter stack still running over IPv6. + +config CHIP_OPENTHREAD_JOINER_ENABLED + bool "Specify whether the Thread Joiner functionality is used when it is enabled" + default n + depends on NET_L2_OPENTHREAD + depends on OPENTHREAD_JOINER + help + If disabled, it allows to optimize memory usage even if Thread Joiner + support is enabled. + +endif # CHIP diff --git a/config/nrfconnect/chip-module/Kconfig.defaults b/config/nrfconnect/chip-module/Kconfig.defaults index 30611686b1e41a..49a219eacdd491 100644 --- a/config/nrfconnect/chip-module/Kconfig.defaults +++ b/config/nrfconnect/chip-module/Kconfig.defaults @@ -65,6 +65,18 @@ config FPU config SHELL default y +config SHELL_MINIMAL + default y + +# Enable getting reboot reasons information +config HWINFO + bool + default y + +config HWINFO_SHELL + bool + default n + config PTHREAD_IPC bool default n @@ -75,7 +87,7 @@ config POSIX_MAX_FDS # Application stack size config MAIN_STACK_SIZE - default 8192 + default 6144 config INIT_STACKS default y @@ -88,16 +100,16 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT # Network buffers config NET_PKT_RX_COUNT - default 16 + default 8 config NET_PKT_TX_COUNT - default 16 + default 8 config NET_BUF_RX_COUNT - default 80 + default 16 config NET_BUF_TX_COUNT - default 80 + default 16 # Bluetooth Low Energy configs @@ -162,6 +174,14 @@ config BT_DEVICE_NAME_GATT_WRITABLE bool default n +config BT_GATT_CACHING + bool + default n + +# Disable 2M PHY due to interoperability issues. +config BT_CTLR_PHY_2M + default n + # Enable NFC support config CHIP_NFC_COMMISSIONING @@ -196,9 +216,6 @@ endif # BOARD_NRF7002DK_NRF5340_CPUAPP config CHIP_EXTENDED_DISCOVERY default n -config NVS_LOOKUP_CACHE - default y - config NVS_LOOKUP_CACHE_SIZE default 512 @@ -209,6 +226,10 @@ config NET_L2_OPENTHREAD if NET_L2_OPENTHREAD +# Disable OpenThread shell +config OPENTHREAD_SHELL + default n + # Disable certain parts of Zephyr IPv6 stack config NET_IPV6_NBR_CACHE bool @@ -218,6 +239,9 @@ config NET_IPV6_NBR_CACHE config IEEE802154_NRF5_RX_STACK_SIZE default 1024 +config OPENTHREAD_THREAD_STACK_SIZE + default 4096 + endif if CHIP_WIFI @@ -226,9 +250,40 @@ choice WPA_SUPP_LOG_LEVEL_CHOICE default WPA_SUPP_LOG_LEVEL_ERR endchoice +# increase the prefixes limit to match +# maximum number of IPv6 addresses per interface +config NET_IF_IPV6_PREFIX_COUNT + default 6 + +# it saves us 20kB of FLASH +config WPA_SUPP_NO_DEBUG + default y + +config NRF700X_LOG_VERBOSE + default n + +choice WIFI_NRF700X_LOG_LEVEL_CHOICE + default WIFI_NRF700X_LOG_LEVEL_OFF +endchoice + config NRF_WIFI_LOW_POWER default n +config NRF700X_RX_NUM_BUFS + default 16 + +config NRF700X_TX_MAX_DATA_SIZE + default 1280 + +config NRF700X_RX_MAX_DATA_SIZE + default 1280 + +config NRF700X_MAX_TX_TOKENS + default 10 + +config NRF700X_MAX_TX_AGGREGATION + default 1 + config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG default n @@ -243,7 +298,7 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT default 8 config NET_SOCKETS_POLL_MAX - default 4 + default 6 config MBEDTLS_SSL_OUT_CONTENT_LEN default 900 @@ -260,13 +315,13 @@ config SHELL_STACK_SIZE default 2616 config HEAP_MEM_POOL_SIZE - default 200000 - -config CHIP_MALLOC_SYS_HEAP_SIZE - default 28672 # 28 kB + default 80000 endif +config CHIP_MALLOC_SYS_HEAP_SIZE + default 28672 if CHIP_WIFI + default 8192 if NET_L2_OPENTHREAD # Enable mbedTLS from nrf_security library @@ -284,7 +339,7 @@ config MBEDTLS_ENABLE_HEAP default y config MBEDTLS_HEAP_SIZE - default 15360 + default 8192 config MBEDTLS_TLS_LIBRARY default y @@ -351,37 +406,10 @@ config MBEDTLS_GCM_C config MBEDTLS_RSA_C default n -config PSA_WANT_KEY_TYPE_CHACHA20 - default n - -config PSA_WANT_ALG_GCM - default n - -config PSA_WANT_ALG_CHACHA20_POLY1305 - default n - -config PSA_WANT_ALG_SHA_1 - default n - -config PSA_WANT_ALG_SHA_224 - default n - -config PSA_WANT_ALG_SHA_384 - default n - -config PSA_WANT_ALG_SHA_512 - default n - -config PSA_WANT_ALG_RIPEMD160 - default n - -config PSA_WANT_ALG_MD5 - default n - -config PSA_WANT_ALG_CFB +config MBEDTLS_SSL_SRV_C default n -config PSA_WANT_ALG_OFB +config MBEDTLS_SSL_COOKIE_C default n # Disable not used shell modules diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 9b5a1e7aee9029..a6c2ea99ad431d 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -21,7 +21,7 @@ if CHIP config CHIP_WIFI bool "Enable nrfconnect Wi-Fi support" - default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP + default y if SHIELD_NRF7002EK || BOARD_NRF7002DK_NRF5340_CPUAPP || SHIELD_NRF7002EB select WIFI_NRF700X select WIFI select WPA_SUPP @@ -73,6 +73,20 @@ config SPI_NOR_FLASH_LAYOUT_PAGE_SIZE endif # CHIP_SPI_NOR +config CHIP_MEMORY_PROFILING + bool "Enable features for tracking memory usage" + select CHIP_STATISTICS + select CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT if CHIP_MALLOC_SYS_HEAP + select MBEDTLS_MEMORY_DEBUG if !CHIP_CRYPTO_PSA + select SYS_HEAP_RUNTIME_STATS if CHIP_MALLOC_SYS_HEAP + select KERNEL_SHELL + select NET_STATISTICS + select NET_SHELL + select NET_BUF_POOL_USAGE + select OPENTHREAD_SHELL if !CHIP_WIFI + help + Enables features for tracking memory usage in Matter. + config CHIP_NUS bool "Enable Nordic UART service for Matter purposes" select BT_NUS @@ -270,7 +284,7 @@ endchoice config CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY int "After removing the last fabric wait defined time [in milliseconds] to perform an action" depends on !CHIP_LAST_FABRIC_REMOVED_NONE - default 500 + default 1000 help After removing the last fabric the device will wait for the defined time and then perform an action chosen by the CHIP_LAST_FABRIC_REMOVED_ACTION option. This schedule will allow for diff --git a/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.defaults b/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.defaults index 83290b2b492f28..17c7115e28b750 100644 --- a/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.defaults +++ b/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.defaults @@ -58,6 +58,10 @@ config BT_CTLR_ASSERT_HANDLER config BT_HCI_RAW_RESERVE default 1 +# Disable 2M PHY due to interoperability issues. +config BT_CTLR_PHY_2M + default n + # Workaround: Unable to allocate command buffer when using K_NO_WAIT since # Host number of completed commands does not follow normal flow control. config BT_BUF_CMD_TX_COUNT diff --git a/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults b/config/nrfconnect/chip-module/Kconfig.mcuboot.defaults index 72169ca50afd8e..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 @@ -140,6 +144,9 @@ config FLASH_SIMULATOR_STATS config ENABLE_MGMT_PERUSER default y +config ZCBOR + default y + config BOOT_MGMT_CUSTOM_STORAGE_ERASE default y diff --git a/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults b/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults index eb0b01e2664ce7..3d40e47429a074 100644 --- a/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults +++ b/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.defaults @@ -58,6 +58,10 @@ config BT_CTLR_ASSERT_HANDLER config BT_HCI_RAW_RESERVE default 1 +# Disable 2M PHY due to interoperability issues. +config BT_CTLR_PHY_2M + default n + # Workaround: Unable to allocate command buffer when using K_NO_WAIT since # Host number of completed commands does not follow normal flow control. config BT_BUF_CMD_TX_COUNT diff --git a/config/nrfconnect/chip-module/generate_factory_data.cmake b/config/nrfconnect/chip-module/generate_factory_data.cmake index 491411cb6a3dd4..dc1794562d89cf 100644 --- a/config/nrfconnect/chip-module/generate_factory_data.cmake +++ b/config/nrfconnect/chip-module/generate_factory_data.cmake @@ -180,7 +180,7 @@ endfunction() # function(nrfconnect_generate_factory_data) -find_package(Python REQUIRED) +find_package(Python3 REQUIRED) # CHIP_ROOT must be provided as a reference set all localization of scripts if(NOT CHIP_ROOT) diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 4ebccfa2c0b0c6..bd4b52ecb7a193 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -453,6 +453,12 @@ config CHIP_MALLOC_SYS_HEAP_SIZE the heap used by the memory allocation functions based on sys_heap from Zephyr RTOS. +config CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT + bool "Enable support for heap watermarks based on Zephyr sys_heap" + help + Enables support for getting current heap high watermark and resetting + watermarks. + endif module = MATTER diff --git a/examples/all-clusters-app/ameba/README.md b/examples/all-clusters-app/ameba/README.md index ab7f1a5726765f..139512593a0fef 100644 --- a/examples/all-clusters-app/ameba/README.md +++ b/examples/all-clusters-app/ameba/README.md @@ -27,11 +27,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 - Setup build environment: diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 86568566378149..0de8aae99d1fca 100644 --- a/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/all-clusters-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,12 +14,19 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; + /* Disable unused peripherals to reduce power consumption */ &adc { status = "disabled"; diff --git a/examples/all-clusters-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay b/examples/all-clusters-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay index 3063fbbcdee779..2ccc13adb1ddc0 100644 --- a/examples/all-clusters-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay +++ b/examples/all-clusters-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/all-clusters-app/nrfconnect/prj_dfu.conf b/examples/all-clusters-app/nrfconnect/prj_dfu.conf index e57438bf5c1aa5..ca8f536fafce18 100644 --- a/examples/all-clusters-app/nrfconnect/prj_dfu.conf +++ b/examples/all-clusters-app/nrfconnect/prj_dfu.conf @@ -41,3 +41,7 @@ CONFIG_ASSERT_VERBOSE=n CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_ASSERT_NO_COND_INFO=y CONFIG_ASSERT_NO_MSG_INFO=y + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/all-clusters-app/nrfconnect/prj_release.conf b/examples/all-clusters-app/nrfconnect/prj_release.conf index fee661a740cccb..ebe3a71f8765eb 100644 --- a/examples/all-clusters-app/nrfconnect/prj_release.conf +++ b/examples/all-clusters-app/nrfconnect/prj_release.conf @@ -47,3 +47,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_ASSERT_VERBOSE=n CONFIG_PRINTK=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/all-clusters-minimal-app/ameba/README.md b/examples/all-clusters-minimal-app/ameba/README.md index 86c2a0f222f3a1..1583fe5fccea87 100644 --- a/examples/all-clusters-minimal-app/ameba/README.md +++ b/examples/all-clusters-minimal-app/ameba/README.md @@ -27,13 +27,13 @@ The CHIP demo application is supported on - Pull docker image: ``` - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 ``` - Run docker container: ``` - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 ``` - Setup build environment: diff --git a/examples/all-clusters-minimal-app/nrfconnect/prj.conf b/examples/all-clusters-minimal-app/nrfconnect/prj.conf index e1613a896fd6d8..0491fbb825666f 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/prj.conf +++ b/examples/all-clusters-minimal-app/nrfconnect/prj.conf @@ -44,3 +44,7 @@ CONFIG_CHIP_OTA_REQUESTOR=n # Disable QSPI NOR CONFIG_CHIP_QSPI_NOR=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/all-clusters-minimal-app/nrfconnect/prj_release.conf b/examples/all-clusters-minimal-app/nrfconnect/prj_release.conf index 7f64115af32736..e885563a98618f 100644 --- a/examples/all-clusters-minimal-app/nrfconnect/prj_release.conf +++ b/examples/all-clusters-minimal-app/nrfconnect/prj_release.conf @@ -47,3 +47,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_ASSERT_VERBOSE=n CONFIG_PRINTK=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/light-switch-app/ameba/README.md b/examples/light-switch-app/ameba/README.md index 835b11ea444c59..48ab417a33dff5 100644 --- a/examples/light-switch-app/ameba/README.md +++ b/examples/light-switch-app/ameba/README.md @@ -26,11 +26,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 - Setup build environment: diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 12d4454c91bcd5..abd1a0c6d1a2b0 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -67,6 +67,7 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 3063fbbcdee779..2ccc13adb1ddc0 100644 --- a/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/light-switch-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/light-switch-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay b/examples/light-switch-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay index 3063fbbcdee779..2ccc13adb1ddc0 100644 --- a/examples/light-switch-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay +++ b/examples/light-switch-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/light-switch-app/nrfconnect/prj.conf b/examples/light-switch-app/nrfconnect/prj.conf index 726846ae48cee5..2327bafd36bff9 100644 --- a/examples/light-switch-app/nrfconnect/prj.conf +++ b/examples/light-switch-app/nrfconnect/prj.conf @@ -41,3 +41,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/light-switch-app/nrfconnect/prj_release.conf b/examples/light-switch-app/nrfconnect/prj_release.conf index e033650db1d427..5366a4f3dc3b6c 100644 --- a/examples/light-switch-app/nrfconnect/prj_release.conf +++ b/examples/light-switch-app/nrfconnect/prj_release.conf @@ -54,3 +54,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/lighting-app/ameba/README.md b/examples/lighting-app/ameba/README.md index 012ac3b89be5da..9c7b13ffa22838 100644 --- a/examples/lighting-app/ameba/README.md +++ b/examples/lighting-app/ameba/README.md @@ -23,11 +23,11 @@ The CHIP demo application is supported on - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 - Setup build environment: diff --git a/examples/lighting-app/nrfconnect/CMakeLists.txt b/examples/lighting-app/nrfconnect/CMakeLists.txt index bf378bc4468339..a4480b43f0afc6 100644 --- a/examples/lighting-app/nrfconnect/CMakeLists.txt +++ b/examples/lighting-app/nrfconnect/CMakeLists.txt @@ -72,6 +72,7 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 240f0aaffa190f..3a80c7a3552b7a 100644 --- a/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/lighting-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; @@ -36,6 +38,11 @@ }; }; +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; + &pwm0 { pinctrl-0 = <&pwm0_default_alt>; pinctrl-1 = <&pwm0_sleep_alt>; diff --git a/examples/lighting-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay b/examples/lighting-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay index de203e27aa1f69..2a8c6bb21f8c4b 100644 --- a/examples/lighting-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay +++ b/examples/lighting-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; @@ -36,6 +38,11 @@ }; }; +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; + &pwm0 { pinctrl-0 = <&pwm0_default_alt>; pinctrl-1 = <&pwm0_sleep_alt>; diff --git a/examples/lighting-app/nrfconnect/prj.conf b/examples/lighting-app/nrfconnect/prj.conf index 3419b5b0fc7087..38c8be587d5600 100644 --- a/examples/lighting-app/nrfconnect/prj.conf +++ b/examples/lighting-app/nrfconnect/prj.conf @@ -49,3 +49,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/lighting-app/nrfconnect/prj_release.conf b/examples/lighting-app/nrfconnect/prj_release.conf index 1977239abf0d4b..4468a07e40b088 100644 --- a/examples/lighting-app/nrfconnect/prj_release.conf +++ b/examples/lighting-app/nrfconnect/prj_release.conf @@ -57,3 +57,8 @@ CONFIG_ASSERT_VERBOSE=n CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index daa594239e89b7..38e99561b3bbce 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -69,5 +69,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index 7042eb46be3fad..77aa955f0d277c 100644 --- a/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,12 +14,19 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; + /* Disable unused peripherals to reduce power consumption */ &adc { status = "disabled"; diff --git a/examples/lock-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay b/examples/lock-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay index 3063fbbcdee779..2ccc13adb1ddc0 100644 --- a/examples/lock-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay +++ b/examples/lock-app/nrfconnect/boards/nrf7002dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp index 624bac3c73e5aa..99ea77ee21adb9 100644 --- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp @@ -128,7 +128,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint) // Set FeatureMap to (kUser|kPinCredential), default is: // (kUser|kAccessSchedules|kRfidCredential|kPinCredential) 0x113 - logOnFailure(DoorLock::Attributes::FeatureMap::Set(endpoint, 0x101), "feature map"); + logOnFailure(DoorLock::Attributes::FeatureMap::Set(endpoint, 0x181), "feature map"); AppTask::Instance().UpdateClusterState(BoltLockMgr().GetState(), BoltLockManager::OperationSource::kUnspecified); } diff --git a/examples/lock-app/nrfconnect/prj.conf b/examples/lock-app/nrfconnect/prj.conf index 3216fbc3190af9..a12cb1e6594024 100644 --- a/examples/lock-app/nrfconnect/prj.conf +++ b/examples/lock-app/nrfconnect/prj.conf @@ -38,3 +38,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/lock-app/nrfconnect/prj_release.conf b/examples/lock-app/nrfconnect/prj_release.conf index 6f0c11ba41dd18..24fc9cd1cbdef8 100644 --- a/examples/lock-app/nrfconnect/prj_release.conf +++ b/examples/lock-app/nrfconnect/prj_release.conf @@ -51,3 +51,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/ota-requestor-app/ameba/README.md b/examples/ota-requestor-app/ameba/README.md index 2ce04fc328ceed..8f701e2ba6952c 100644 --- a/examples/ota-requestor-app/ameba/README.md +++ b/examples/ota-requestor-app/ameba/README.md @@ -6,11 +6,11 @@ A prototype application that demonstrates OTA Requestor capabilities. - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 - Setup build environment: diff --git a/examples/pigweed-app/ameba/README.md b/examples/pigweed-app/ameba/README.md index d294295bc5f0e5..f115117d3db775 100644 --- a/examples/pigweed-app/ameba/README.md +++ b/examples/pigweed-app/ameba/README.md @@ -31,11 +31,11 @@ following features are available: - Pull docker image: - $ docker pull ghcr.io/project-chip/chip-build-ameba:22 + $ docker pull ghcr.io/project-chip/chip-build-ameba:24 - Run docker container: - $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:22 + $ docker run -it -v ${CHIP_DIR}:/root/chip ghcr.io/project-chip/chip-build-ameba:24 - Setup build environment: diff --git a/examples/platform/nrfconnect/util/DFUOverSMP.cpp b/examples/platform/nrfconnect/util/DFUOverSMP.cpp index ac59171598127f..7d8eb38945ad50 100644 --- a/examples/platform/nrfconnect/util/DFUOverSMP.cpp +++ b/examples/platform/nrfconnect/util/DFUOverSMP.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -41,7 +42,8 @@ constexpr uint16_t kAdvertisingIntervalMax = 500; constexpr uint8_t kAdvertisingFlags = BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR; namespace { -int32_t UploadConfirmHandler(uint32_t event, int32_t rc, bool * abort_more, void * data, size_t data_size) +enum mgmt_cb_return UploadConfirmHandler(uint32_t event, enum mgmt_cb_return prev_status, int32_t * rc, uint16_t * group, + bool * abort_more, void * data, size_t data_size) { const img_mgmt_upload_check & imgData = *static_cast(data); IgnoreUnusedVariable(imgData); @@ -49,10 +51,11 @@ int32_t UploadConfirmHandler(uint32_t event, int32_t rc, bool * abort_more, void ChipLogProgress(SoftwareUpdate, "DFU over SMP progress: %u/%u B of image %u", static_cast(imgData.req->off), static_cast(imgData.action->size), static_cast(imgData.req->image)); - return MGMT_ERR_EOK; + return MGMT_CB_OK; } -int32_t CommandHandler(uint32_t event, int32_t rc, bool * abort_more, void * data, size_t data_size) +enum mgmt_cb_return CommandHandler(uint32_t event, enum mgmt_cb_return prev_status, int32_t * rc, uint16_t * group, + bool * abort_more, void * data, size_t data_size) { if (event == MGMT_EVT_OP_CMD_RECV) { @@ -63,7 +66,7 @@ int32_t CommandHandler(uint32_t event, int32_t rc, bool * abort_more, void * dat GetFlashHandler().DoAction(ExternalFlashManager::Action::SLEEP); } - return MGMT_ERR_EOK; + return MGMT_CB_OK; } mgmt_callback sUploadCallback = { diff --git a/examples/pump-app/nrfconnect/CMakeLists.txt b/examples/pump-app/nrfconnect/CMakeLists.txt index 94ae9180fb6392..7682c0ca663ffd 100644 --- a/examples/pump-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-app/nrfconnect/CMakeLists.txt @@ -68,5 +68,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index ca5ebd2d034af0..f36333ff359b87 100644 --- a/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/pump-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/pump-app/nrfconnect/prj.conf b/examples/pump-app/nrfconnect/prj.conf index 008a66be940be3..8940955d52b403 100644 --- a/examples/pump-app/nrfconnect/prj.conf +++ b/examples/pump-app/nrfconnect/prj.conf @@ -38,3 +38,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/pump-app/nrfconnect/prj_release.conf b/examples/pump-app/nrfconnect/prj_release.conf index fbcfe2fe16545e..ac2b6e09ade94d 100644 --- a/examples/pump-app/nrfconnect/prj_release.conf +++ b/examples/pump-app/nrfconnect/prj_release.conf @@ -51,3 +51,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/pump-controller-app/nrfconnect/CMakeLists.txt b/examples/pump-controller-app/nrfconnect/CMakeLists.txt index 8a5b8f4193b245..52ece075e286ee 100644 --- a/examples/pump-controller-app/nrfconnect/CMakeLists.txt +++ b/examples/pump-controller-app/nrfconnect/CMakeLists.txt @@ -68,5 +68,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index ca5ebd2d034af0..f36333ff359b87 100644 --- a/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/pump-controller-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,8 +14,15 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; }; }; + +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; diff --git a/examples/pump-controller-app/nrfconnect/prj.conf b/examples/pump-controller-app/nrfconnect/prj.conf index f8774b9f2f0f4b..857ad459b83707 100644 --- a/examples/pump-controller-app/nrfconnect/prj.conf +++ b/examples/pump-controller-app/nrfconnect/prj.conf @@ -38,3 +38,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/pump-controller-app/nrfconnect/prj_release.conf b/examples/pump-controller-app/nrfconnect/prj_release.conf index bd9e21dae49b03..6826b31ca3679b 100644 --- a/examples/pump-controller-app/nrfconnect/prj_release.conf +++ b/examples/pump-controller-app/nrfconnect/prj_release.conf @@ -52,3 +52,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/window-app/nrfconnect/CMakeLists.txt b/examples/window-app/nrfconnect/CMakeLists.txt index 74b2b9e13a0c6f..21eee307f1f388 100644 --- a/examples/window-app/nrfconnect/CMakeLists.txt +++ b/examples/window-app/nrfconnect/CMakeLists.txt @@ -71,5 +71,6 @@ if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) endif() if(CONFIG_MCUMGR_TRANSPORT_BT) + zephyr_library_link_libraries(MCUBOOT_BOOTUTIL) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() diff --git a/examples/window-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay b/examples/window-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay index dad630c7c9aad9..57481eaa83de08 100644 --- a/examples/window-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay +++ b/examples/window-app/nrfconnect/boards/nrf5340dk_nrf5340_cpuapp.overlay @@ -14,6 +14,8 @@ * limitations under the License. */ +#include + / { chosen { nordic,pm-ext-flash = &mx25r64; @@ -39,6 +41,11 @@ }; }; +/* Set IPC thread priority to the highest value to not collide with other threads. */ +&ipc0 { + zephyr,priority = <0 PRIO_COOP>; +}; + /* Disable unused peripherals to reduce power consumption */ &adc { status = "disabled"; diff --git a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp index d4a1c541c93bbc..63b9b10d32b852 100644 --- a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp +++ b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp @@ -79,3 +79,58 @@ void MatterWindowCoveringClusterServerAttributeChangedCallback(const app::Concre }; } } + +void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint) +{ + const auto logOnFailure = [](EmberAfStatus status, const char * attributeName) { + if (status != EMBER_ZCL_STATUS_SUCCESS) + { + ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, status); + } + }; + + app::DataModel::Nullable currentPercent100ths; + app::DataModel::Nullable targetPercent100ths; + app::DataModel::Nullable currentPercentage; + EmberAfStatus status; + + status = Attributes::CurrentPositionLiftPercentage::Get(endpoint, currentPercentage); + if (currentPercentage.IsNull()) + { + logOnFailure(Attributes::CurrentPositionLiftPercentage::Set(endpoint, 0), "current position lift percentage"); + } + + status = Attributes::CurrentPositionTiltPercentage::Get(endpoint, currentPercentage); + if (currentPercentage.IsNull()) + { + logOnFailure(Attributes::CurrentPositionTiltPercentage::Set(endpoint, 0), "current position tilt percentage"); + } + + status = Attributes::CurrentPositionLiftPercent100ths::Get(endpoint, currentPercent100ths); + if (currentPercent100ths.IsNull()) + { + currentPercent100ths.SetNonNull(0); + logOnFailure(Attributes::CurrentPositionLiftPercent100ths::Set(endpoint, 0), "current position lift percent 100ths"); + } + + status = Attributes::TargetPositionLiftPercent100ths::Get(endpoint, targetPercent100ths); + if (targetPercent100ths.IsNull()) + { + logOnFailure(Attributes::TargetPositionLiftPercent100ths::Set(endpoint, currentPercent100ths), + "target position lift percent 100ths"); + } + + status = Attributes::CurrentPositionTiltPercent100ths::Get(endpoint, currentPercent100ths); + if (currentPercent100ths.IsNull()) + { + currentPercent100ths.SetNonNull(0); + logOnFailure(Attributes::CurrentPositionTiltPercent100ths::Set(endpoint, 0), "current position tilt percent 100ths"); + } + + status = Attributes::TargetPositionTiltPercent100ths::Get(endpoint, targetPercent100ths); + if (targetPercent100ths.IsNull()) + { + logOnFailure(Attributes::TargetPositionTiltPercent100ths::Set(endpoint, currentPercent100ths), + "target position tilt percent 100ths"); + } +} diff --git a/examples/window-app/nrfconnect/prj.conf b/examples/window-app/nrfconnect/prj.conf index 48bc61f67d5a47..392e84ee268a54 100644 --- a/examples/window-app/nrfconnect/prj.conf +++ b/examples/window-app/nrfconnect/prj.conf @@ -49,3 +49,7 @@ CONFIG_RESET_ON_FATAL_ERROR=n # Reduce application size CONFIG_USE_SEGGER_RTT=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/examples/window-app/nrfconnect/prj_release.conf b/examples/window-app/nrfconnect/prj_release.conf index 8143a5d60ad7e8..e7859efaa81de6 100644 --- a/examples/window-app/nrfconnect/prj_release.conf +++ b/examples/window-app/nrfconnect/prj_release.conf @@ -67,3 +67,8 @@ CONFIG_ASSERT_NO_FILE_INFO=y CONFIG_PRINTK=n CONFIG_PRINTK_SYNC=n CONFIG_THREAD_NAME=n +CONFIG_BOOT_BANNER=n + +# Enable Factory Data feature +CONFIG_CHIP_FACTORY_DATA=y +CONFIG_CHIP_FACTORY_DATA_BUILD=y diff --git a/integrations/cloudbuild/build-all.yaml b/integrations/cloudbuild/build-all.yaml index f2c73a5eb2cd17..58df032c9804ef 100644 --- a/integrations/cloudbuild/build-all.yaml +++ b/integrations/cloudbuild/build-all.yaml @@ -6,7 +6,7 @@ steps: - "--init" - "--recursive" id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -21,7 +21,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -85,7 +85,7 @@ steps: --target k32w-shell build --create-archives /workspace/artifacts/ - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/chef.yaml b/integrations/cloudbuild/chef.yaml index d0989a173705c7..096a8833b13cf5 100644 --- a/integrations/cloudbuild/chef.yaml +++ b/integrations/cloudbuild/chef.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -12,7 +12,7 @@ steps: path: /pwenv timeout: 2700s - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -27,7 +27,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: diff --git a/integrations/cloudbuild/smoke-test.yaml b/integrations/cloudbuild/smoke-test.yaml index ef5e12328b7181..ff653f12494653 100644 --- a/integrations/cloudbuild/smoke-test.yaml +++ b/integrations/cloudbuild/smoke-test.yaml @@ -1,5 +1,5 @@ steps: - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" entrypoint: "bash" args: - "-c" @@ -7,7 +7,7 @@ steps: git config --global --add safe.directory "*" git submodule update --init --recursive id: Submodules - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" env: - PW_ENVIRONMENT_ROOT=/pwenv args: @@ -22,7 +22,7 @@ steps: path: /pwenv timeout: 900s - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" id: ESP32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -43,7 +43,7 @@ steps: volumes: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" id: NRFConnect env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -64,7 +64,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" id: EFR32 env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -86,7 +86,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" id: Linux env: - PW_ENVIRONMENT_ROOT=/pwenv @@ -139,7 +139,7 @@ steps: - name: pwenv path: /pwenv - - name: "ghcr.io/project-chip/chip-build-vscode:22" + - name: "ghcr.io/project-chip/chip-build-vscode:24" id: Android env: - PW_ENVIRONMENT_ROOT=/pwenv diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index d699d60ebd0148..9bc4f9596efc26 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -161,7 +161,7 @@ def generate(self): zephyr_base = os.environ['ZEPHYR_BASE'] nrfconnect_sdk = os.path.dirname(zephyr_base) zephyr_sdk_dir = os.environ.get('ZEPHYR_SDK_INSTALL_DIR') or os.path.join( - os.environ['NRF5_TOOLS_ROOT'], 'zephyr-sdk-0.16.0') + os.environ['NRF5_TOOLS_ROOT'], 'zephyr-sdk-0.16.1') # NRF builds will both try to change .west/config in nrfconnect and # overall perform a git fetch on that location diff --git a/scripts/examples/nrfconnect_example.sh b/scripts/examples/nrfconnect_example.sh index db1c850ff5e9a9..0a7c46d7e9baef 100755 --- a/scripts/examples/nrfconnect_example.sh +++ b/scripts/examples/nrfconnect_example.sh @@ -44,7 +44,7 @@ source "../scripts/activate.sh" export ZEPHYR_TOOLCHAIN_VARIANT=zephyr if [[ -z "$ZEPHYR_SDK_INSTALL_DIR" && -n "$NRF5_TOOLS_ROOT" ]]; then - export ZEPHYR_SDK_INSTALL_DIR="$NRF5_TOOLS_ROOT"/zephyr-sdk-0.16.0 + export ZEPHYR_SDK_INSTALL_DIR="$NRF5_TOOLS_ROOT"/zephyr-sdk-0.16.1 fi # Set ccache base directory to improve the cache hit ratio diff --git a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp index b1d0012761092c..7a5d9c265b1880 100644 --- a/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp +++ b/src/include/platform/internal/GenericPlatformManagerImpl_Zephyr.ipp @@ -34,6 +34,7 @@ #include #include +#include #include @@ -139,6 +140,8 @@ CHIP_ERROR GenericPlatformManagerImpl_Zephyr::_PostEvent(const ChipDe return System::MapErrorZephyr(status); } + SYSTEM_STATS_INCREMENT(System::Stats::kPlatformMgr_NumEvents); + // Wake CHIP thread to process the event. If the function is called from ISR, such as a Zephyr // timer handler, do not signal the thread directly because that involves taking a mutex, which // is forbidden in ISRs. Instead, submit a task to the system work queue to do the singalling. @@ -159,7 +162,10 @@ void GenericPlatformManagerImpl_Zephyr::ProcessDeviceEvents() ChipDeviceEvent event; while (k_msgq_get(&mChipEventQueue, &event, K_NO_WAIT) == 0) + { + SYSTEM_STATS_DECREMENT(System::Stats::kPlatformMgr_NumEvents); Impl()->DispatchEvent(&event); + } } template diff --git a/src/lib/shell/commands/Stat.cpp b/src/lib/shell/commands/Stat.cpp index c67db5468bf47f..88262e1e8daa1a 100644 --- a/src/lib/shell/commands/Stat.cpp +++ b/src/lib/shell/commands/Stat.cpp @@ -21,6 +21,14 @@ #include #include +#if CHIP_HAVE_CONFIG_H +#include +#endif // CHIP_HAVE_CONFIG_H + +#if CHIP_CRYPTO_MBEDTLS +#include +#endif + using namespace chip; namespace chip { @@ -46,6 +54,15 @@ CHIP_ERROR StatPeakHandler(int argc, char ** argv) streamer_printf(streamer_get(), "Heap allocated bytes: %u\r\n", static_cast(heapWatermark)); } +#if CHIP_CRYPTO_MBEDTLS && defined(MBEDTLS_MEMORY_DEBUG) + size_t maxUsed = 0; + size_t maxBlocks = 0; + + mbedtls_memory_buffer_alloc_max_get(&maxUsed, &maxBlocks); + + streamer_printf(streamer_get(), "mbedTLS heap allocated bytes: %u\r\n", static_cast(maxUsed)); +#endif + return CHIP_NO_ERROR; } @@ -64,6 +81,10 @@ CHIP_ERROR StatResetHandler(int argc, char ** argv) ReturnErrorOnFailure(DeviceLayer::GetDiagnosticDataProvider().ResetWatermarks()); } +#if CHIP_CRYPTO_MBEDTLS && defined(MBEDTLS_MEMORY_DEBUG) + mbedtls_memory_buffer_alloc_max_reset(); +#endif + return CHIP_NO_ERROR; } diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index a75f791966ac41..0d19ae192b5e36 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -499,9 +499,13 @@ ConnectivityManager::ThreadDeviceType GenericThreadStackManagerImpl_OpenThread= 347 + if (otLinkGetCslPeriod(mOTInst) != 0) +#else if (otLinkCslGetPeriod(mOTInst) != 0) +#endif // OPENTHREAD_API_VERSION ExitNow(deviceType = ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice); -#endif +#endif // CHIP_DEVICE_CONFIG_THREAD_SSED ExitNow(deviceType = ConnectivityManager::kThreadDeviceType_SleepyEndDevice); @@ -1765,8 +1769,13 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetPollingInter // * poll period for SED devices that poll the parent for data // * CSL period for SSED devices that listen for messages in scheduled time slots. #if CHIP_DEVICE_CONFIG_THREAD_SSED +#if OPENTHREAD_API_VERSION >= 347 + // Get CSL period in units of us and divide by 1000 to get milliseconds. + uint32_t curIntervalMS = otLinkGetCslPeriod(mOTInst) / 1000; +#else // Get CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. uint32_t curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; +#endif // OPENTHREAD_API_VERSION #else uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst); #endif @@ -1774,9 +1783,15 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetPollingInter if (pollingInterval.count() != curIntervalMS) { #if CHIP_DEVICE_CONFIG_THREAD_SSED +#if OPENTHREAD_API_VERSION >= 347 + // Set CSL period in units of us and divide by 1000 to get milliseconds. + otErr = otLinkSetCslPeriod(mOTInst, pollingInterval.count() * 1000); + curIntervalMS = otLinkGetCslPeriod(mOTInst) / 1000; +#else // Set CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. otErr = otLinkCslSetPeriod(mOTInst, pollingInterval.count() * 1000 / OT_US_PER_TEN_SYMBOLS); curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; +#endif // OPENTHREAD_API_VERSION #else otErr = otLinkSetPollPeriod(mOTInst, pollingInterval.count()); curIntervalMS = otLinkGetPollPeriod(mOTInst); diff --git a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp index 82bfbcb17fe5e9..3c0a106aea7412 100644 --- a/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp +++ b/src/platform/Zephyr/DiagnosticDataProviderImpl.cpp @@ -123,7 +123,7 @@ DiagnosticDataProviderImpl::DiagnosticDataProviderImpl() : mBootReason(Determine bool DiagnosticDataProviderImpl::SupportsWatermarks() { -#ifdef CONFIG_CHIP_MALLOC_SYS_HEAP +#if defined(CONFIG_CHIP_MALLOC_SYS_HEAP) && defined(CONFIG_CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT) return true; #else return false; @@ -165,7 +165,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapUsed(uint64_t & currentHeap CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & currentHeapHighWatermark) { -#ifdef CONFIG_CHIP_MALLOC_SYS_HEAP +#if defined(CONFIG_CHIP_MALLOC_SYS_HEAP) && defined(CONFIG_CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT) Malloc::Stats stats; ReturnErrorOnFailure(Malloc::GetStats(stats)); @@ -178,7 +178,7 @@ CHIP_ERROR DiagnosticDataProviderImpl::GetCurrentHeapHighWatermark(uint64_t & cu CHIP_ERROR DiagnosticDataProviderImpl::ResetWatermarks() { -#ifdef CONFIG_CHIP_MALLOC_SYS_HEAP +#if defined(CONFIG_CHIP_MALLOC_SYS_HEAP) && defined(CONFIG_CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT) Malloc::ResetMaxStats(); return CHIP_NO_ERROR; #else diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index cf1b8807e983fa..7461d3650d86a6 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -161,9 +161,11 @@ #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_PRIORITY #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE -#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 8192 +#define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE 6144 #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE +#define CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE 64 + #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_TELEMETRY 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY 0 #define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL 0 diff --git a/src/platform/nrfconnect/Reboot.cpp b/src/platform/nrfconnect/Reboot.cpp index 5b1b6abdde68ad..439adebddc0ea4 100644 --- a/src/platform/nrfconnect/Reboot.cpp +++ b/src/platform/nrfconnect/Reboot.cpp @@ -56,13 +56,7 @@ void Reboot(SoftwareRebootReason reason) { const RetainedReason retainedReason = EncodeReason(reason); - // The parameter passed to sys_reboot() is retained in GPREGRET (general-purpose - // retention register) on nRF52 SOC family, but nRF53 ignores the parameter, so - // set it manually. - -#ifdef CONFIG_SOC_SERIES_NRF53X nrf_power_gpregret_set(NRF_POWER, retainedReason); -#endif sys_reboot(retainedReason); } diff --git a/src/platform/nrfconnect/SystemPlatformConfig.h b/src/platform/nrfconnect/SystemPlatformConfig.h index cd863d5c67dcd4..ce0df4d5f69ff5 100644 --- a/src/platform/nrfconnect/SystemPlatformConfig.h +++ b/src/platform/nrfconnect/SystemPlatformConfig.h @@ -47,4 +47,8 @@ struct ChipDeviceEvent; #define CHIP_SYSTEM_CONFIG_USE_LWIP 0 #define CHIP_SYSTEM_CONFIG_USE_SOCKETS 1 +#ifndef CONFIG_ARCH_POSIX +#define CHIP_SYSTEM_CONFIG_PACKETBUFFER_POOL_SIZE 8 +#endif + // ========== Platform-specific Configuration Overrides ========= diff --git a/src/platform/nrfconnect/wifi/NrfWiFiDriver.cpp b/src/platform/nrfconnect/wifi/NrfWiFiDriver.cpp index 3df9b60c2157de..7576171adb2f76 100644 --- a/src/platform/nrfconnect/wifi/NrfWiFiDriver.cpp +++ b/src/platform/nrfconnect/wifi/NrfWiFiDriver.cpp @@ -147,10 +147,6 @@ CHIP_ERROR NrfWiFiDriver::CommitConfiguration() CHIP_ERROR NrfWiFiDriver::RevertConfiguration() { - // Abort Connection Recovery if it is in progress during reverting configuration. - // This is needed to stop recovery process after failsafe timer expiring. - WiFiManager::Instance().AbortConnectionRecovery(); - LoadFromStorage(); if (WiFiManager::StationStatus::CONNECTING <= WiFiManager::Instance().GetStationStatus()) diff --git a/src/platform/nrfconnect/wifi/WiFiManager.cpp b/src/platform/nrfconnect/wifi/WiFiManager.cpp index 68192516b73437..c3435a954fab50 100644 --- a/src/platform/nrfconnect/wifi/WiFiManager.cpp +++ b/src/platform/nrfconnect/wifi/WiFiManager.cpp @@ -142,8 +142,8 @@ const Map WiFiManager::sEventHandlerMap({ { NET_EVENT_WIFI_SCAN_RESULT, WiFiManager::ScanResultHandler }, { NET_EVENT_WIFI_SCAN_DONE, WiFiManager::ScanDoneHandler }, { NET_EVENT_WIFI_CONNECT_RESULT, WiFiManager::ConnectHandler }, - { NET_EVENT_WIFI_DISCONNECT_RESULT, WiFiManager::NetworkDrivenDisconnectHandler }, - { NET_EVENT_WIFI_DISCONNECT_COMPLETE, WiFiManager::ApplicationDrivenDisconnectHandler } }); + { NET_EVENT_WIFI_DISCONNECT_RESULT, WiFiManager::DisconnectHandler }, + { NET_EVENT_WIFI_DISCONNECT_COMPLETE, WiFiManager::DisconnectHandler } }); void WiFiManager::WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mgmtEvent, net_if * iface) { @@ -168,7 +168,7 @@ CHIP_ERROR WiFiManager::Init() if (maddr && !net_if_ipv6_maddr_is_joined(maddr) && !net_ipv6_is_addr_mcast_link_all_nodes(&addr)) { - net_if_ipv6_maddr_join(maddr); + net_if_ipv6_maddr_join(iface, maddr); } return CHIP_NO_ERROR; @@ -206,32 +206,10 @@ CHIP_ERROR WiFiManager::Scan(const ByteSpan & ssid, ScanResultCallback resultCal mCachedWiFiState = mWiFiState; mWiFiState = WIFI_STATE_SCANNING; mSsidFound = false; - mRecoveryArmed = true; - // TODO Workaround for recovery mechanism to wait before the next scan request until the WiFi supplicant is not busy. - static bool workaroundDone; - int ret = net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0); - - if (ret) + if (0 != net_mgmt(NET_REQUEST_WIFI_SCAN, iface, NULL, 0)) { - ChipLogError(DeviceLayer, "Scan request failed %d", ret); - if (ret == -EBUSY && !workaroundDone) - { - // TODO Wi-Fi driver returned an error during recovery. - // As a workaround schedule the recovery timer one more time in WifiSupplicantWorkaroundTime time. - // This allows the device to run the Scan method without - // rebooting when the "Device or resource busy" error occurs. - DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(kWifiSupplicantWorkaroundTime), Recover, nullptr); - workaroundDone = true; - return CHIP_NO_ERROR; - } - else - { - // TODO The workaround has not worked, so reboot the device - ChipLogError(DeviceLayer, "WiFi driver does not respond, resetting the device..."); - workaroundDone = false; - PlatformMgr().Shutdown(); - } + ChipLogError(DeviceLayer, "Scan request failed"); return CHIP_ERROR_INTERNAL; } @@ -412,21 +390,13 @@ void WiFiManager::ScanDoneHandler(Platform::UniquePtr data) // Internal scan is supposed to be followed by a connection request if the SSID has been found if (Instance().mInternalScan) { - if (Instance().mRecoveryArmed) + + if (!Instance().mSsidFound) { - if (!Instance().mSsidFound) - { - ChipLogProgress(DeviceLayer, "No requested SSID found"); - auto currentTimeout = Instance().CalculateNextRecoveryTime(); - ChipLogProgress(DeviceLayer, "Starting connection recover: re-scanning... (next attempt in %d ms)", - currentTimeout.count()); - DeviceLayer::SystemLayer().StartTimer(currentTimeout, Recover, nullptr); - return; - } - else - { - Instance().AbortConnectionRecovery(); - } + auto currentTimeout = Instance().CalculateNextRecoveryTime(); + ChipLogProgress(DeviceLayer, "Starting connection recover: re-scanning... (next attempt in %d ms)", + currentTimeout.count()); + DeviceLayer::SystemLayer().StartTimer(currentTimeout, Recover, nullptr); } Instance().mWiFiState = WIFI_STATE_ASSOCIATING; @@ -517,8 +487,6 @@ void WiFiManager::ConnectHandler(Platform::UniquePtr data) ChipLogError(DeviceLayer, "Cannot post event [error: %s]", ErrorStr(error)); } } - // Ensure fresh recovery for future connection requests. - Instance().ResetRecoveryTime(); // cleanup the provisioning data as it is configured per each connect request Instance().ClearStationProvisioningData(); }); @@ -530,18 +498,8 @@ void WiFiManager::ConnectHandler(Platform::UniquePtr data) } } -void WiFiManager::NetworkDrivenDisconnectHandler(Platform::UniquePtr) +void WiFiManager::DisconnectHandler(Platform::UniquePtr) { - // Workaround: schedule the application level connection recovery in kSupplicantReconnectionTimeoutMs to give WPA supplicant - // some time to restore it. - if (!Instance().mRecoveryArmed) - { - Instance().mRecoveryArmed = true; - DeviceLayer::SystemLayer().StartTimer( - System::Clock::Milliseconds32(kSupplicantReconnectionTimeoutMs), - [](System::Layer * layer, void * param) { Instance().Disconnect(); }, nullptr); - } - SystemLayer().ScheduleLambda([] { ChipLogProgress(DeviceLayer, "WiFi station disconnected"); Instance().mWiFiState = WIFI_STATE_DISCONNECTED; @@ -549,24 +507,6 @@ void WiFiManager::NetworkDrivenDisconnectHandler(Platform::UniquePtr) }); } -void WiFiManager::ApplicationDrivenDisconnectHandler(Platform::UniquePtr) -{ - if (!Instance().mRecoveryArmed) - { - return; - } - - if (!Instance().mApplicationDisconnectRequested) - { - Instance().AbortConnectionRecovery(); - } - else - { - Instance().mApplicationDisconnectRequested = false; - SystemLayer().ScheduleLambda([] { Recover(nullptr, nullptr); }); - } -} - WiFiManager::StationStatus WiFiManager::GetStationStatus() const { return WiFiManager::sStatusMap[mWiFiState]; @@ -580,23 +520,6 @@ void WiFiManager::PostConnectivityStatusChange(ConnectivityChange changeType) PlatformMgr().PostEventOrDie(&networkEvent); } -System::Clock::Milliseconds32 WiFiManager::CalculateNextRecoveryTime() -{ - if (mConnectionRecoveryTimeMs > kConnectionRecoveryMaxIntervalMs) - { - // Find the new random jitter value in range [-jitter, +jitter]. - int32_t jitter = chip::Crypto::GetRandU32() % (2 * jitter + 1) - jitter; - mConnectionRecoveryTimeMs = kConnectionRecoveryMaxIntervalMs + jitter; - return System::Clock::Milliseconds32(mConnectionRecoveryTimeMs); - } - else - { - uint32_t currentRecoveryTimeout = mConnectionRecoveryTimeMs; - mConnectionRecoveryTimeMs = mConnectionRecoveryTimeMs * 2; - return System::Clock::Milliseconds32(currentRecoveryTimeout); - } -} - void WiFiManager::Recover(System::Layer *, void *) { // Prevent scheduling recovery if we are already connected to the network. @@ -626,7 +549,23 @@ void WiFiManager::AbortConnectionRecovery() { DeviceLayer::SystemLayer().CancelTimer(Recover, nullptr); Instance().ResetRecoveryTime(); - Instance().mRecoveryArmed = false; +} + +System::Clock::Milliseconds32 WiFiManager::CalculateNextRecoveryTime() +{ + if (mConnectionRecoveryTimeMs > kConnectionRecoveryMaxIntervalMs) + { + // Find the new random jitter value in range [-jitter, +jitter]. + int32_t jitter = chip::Crypto::GetRandU32() % (2 * jitter + 1) - jitter; + mConnectionRecoveryTimeMs = kConnectionRecoveryMaxIntervalMs + jitter; + return System::Clock::Milliseconds32(mConnectionRecoveryTimeMs); + } + else + { + uint32_t currentRecoveryTimeout = mConnectionRecoveryTimeMs; + mConnectionRecoveryTimeMs = mConnectionRecoveryTimeMs * 2; + return System::Clock::Milliseconds32(currentRecoveryTimeout); + } } CHIP_ERROR WiFiManager::SetLowPowerMode(bool onoff) diff --git a/src/platform/nrfconnect/wifi/WiFiManager.h b/src/platform/nrfconnect/wifi/WiFiManager.h index a22ab4789173db..248f7dccc67bc7 100644 --- a/src/platform/nrfconnect/wifi/WiFiManager.h +++ b/src/platform/nrfconnect/wifi/WiFiManager.h @@ -173,10 +173,6 @@ class WiFiManager static constexpr uint32_t kConnectionRecoveryMaxIntervalMs = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_MAXIMUM_INTERVAL; static constexpr uint32_t kConnectionRecoveryJitterMs = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_JITTER; static constexpr uint32_t kConnectionRecoveryMaxRetries = CONFIG_CHIP_WIFI_CONNECTION_RECOVERY_MAX_RETRIES_NUMBER; - static constexpr uint32_t kSupplicantReconnectionTimeoutMs = 60000; - - static_assert(kConnectionRecoveryMinIntervalMs < kConnectionRecoveryMaxIntervalMs); - static_assert(kConnectionRecoveryJitterMs <= kConnectionRecoveryMaxIntervalMs); CHIP_ERROR Init(); CHIP_ERROR Scan(const ByteSpan & ssid, ScanResultCallback resultCallback, ScanDoneCallback doneCallback, @@ -200,16 +196,14 @@ class WiFiManager }; constexpr static uint32_t kWifiManagementEvents = NET_EVENT_WIFI_SCAN_RESULT | NET_EVENT_WIFI_SCAN_DONE | - NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_COMPLETE | - NET_EVENT_WIFI_IFACE_STATUS; + NET_EVENT_WIFI_CONNECT_RESULT | NET_EVENT_WIFI_DISCONNECT_RESULT | NET_EVENT_WIFI_IFACE_STATUS; // Event handling static void WifiMgmtEventHandler(net_mgmt_event_callback * cb, uint32_t mgmtEvent, net_if * iface); static void ScanResultHandler(Platform::UniquePtr data); static void ScanDoneHandler(Platform::UniquePtr data); static void ConnectHandler(Platform::UniquePtr data); - static void NetworkDrivenDisconnectHandler(Platform::UniquePtr data); - static void ApplicationDrivenDisconnectHandler(Platform::UniquePtr data); + static void DisconnectHandler(Platform::UniquePtr data); static void PostConnectivityStatusChange(ConnectivityChange changeType); static void SendRouterSolicitation(System::Layer * layer, void * param); @@ -239,10 +233,7 @@ class WiFiManager bool mSsidFound{ false }; uint32_t mConnectionRecoveryCounter{ 0 }; uint32_t mConnectionRecoveryTimeMs{ kConnectionRecoveryMinIntervalMs }; - bool mRecoveryArmed{ false }; bool mApplicationDisconnectRequested{ false }; - // TODO Workaround for recovery mechanism to wait before the next scan request until the WiFi supplicant is not busy. - static constexpr uint32_t kWifiSupplicantWorkaroundTime = 8000; static const Map sStatusMap; static const Map sEventHandlerMap; diff --git a/src/system/SystemStats.cpp b/src/system/SystemStats.cpp index c5be271ea16666..5ef16369ccc853 100644 --- a/src/system/SystemStats.cpp +++ b/src/system/SystemStats.cpp @@ -54,6 +54,7 @@ static const Label sStatsStrings[chip::System::Stats::kNumEntries] = { #endif "Exchange contexts", "Unsolicited message handlers", + "Platform events", }; count_t sResourcesInUse[kNumEntries]; diff --git a/src/system/SystemStats.h b/src/system/SystemStats.h index 9e11b15f38fd12..1bda5f2c5b1623 100644 --- a/src/system/SystemStats.h +++ b/src/system/SystemStats.h @@ -68,6 +68,7 @@ enum #endif kExchangeMgr_NumContexts, kExchangeMgr_NumUMHandlers, + kPlatformMgr_NumEvents, kNumEntries }; diff --git a/src/test_driver/nrfconnect/main/runner.cpp b/src/test_driver/nrfconnect/main/runner.cpp index 7cff68e0efcbc6..99848e423c1390 100644 --- a/src/test_driver/nrfconnect/main/runner.cpp +++ b/src/test_driver/nrfconnect/main/runner.cpp @@ -19,6 +19,8 @@ #include #include +#include + #include #include @@ -27,7 +29,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); @@ -35,5 +37,5 @@ extern "C" void main(void) int status = RunRegisteredUnitTests(); LOG_INF("CHIP test status: %d", status); - exit(status); + _exit(status); } diff --git a/src/test_driver/tizen/README.md b/src/test_driver/tizen/README.md index d1fc7e78447c1c..82108957e4c4fd 100644 --- a/src/test_driver/tizen/README.md +++ b/src/test_driver/tizen/README.md @@ -12,7 +12,7 @@ image from hub.docker.com or build it locally using the provided Dockerfile in ```sh # Pull the image from hub.docker.com -docker pull ghcr.io/project-chip/chip-build-tizen-qemu:22 +docker pull ghcr.io/project-chip/chip-build-tizen-qemu:24 ``` ## Building and Running Tests on QEMU @@ -21,7 +21,7 @@ All steps described below should be done inside the docker container. ```sh docker run -it --rm --name chip-tizen-qemu \ - ghcr.io/project-chip/chip-build-tizen-qemu:22 /bin/bash + ghcr.io/project-chip/chip-build-tizen-qemu:24 /bin/bash ``` ### Clone the connectedhomeip repository