From f1dc9b53b0a4c9b5b38ec901e0b3b6ed56769637 Mon Sep 17 00:00:00 2001 From: Martin Girardot <165289184+Martin-NXP@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:04:21 +0100 Subject: [PATCH] [NXP] Update NXP SDK version to 2.16.100 (#36932) * [NXP][platform][common] remove SDk flag after switching to SDK 2.16.100 Signed-off-by: Martin Girardot * [NXP][submodule] Update nxp matter support submodule Signed-off-by: Martin Girardot * [NXP] Update docker version Signed-off-by: Martin Girardot * [NXP] SDK 2.16.100 updates * [NXP] Update ot-nxp submodule update Signed-off-by: Martin Girardot * Restyled by clang-format * Restyled by gn * [NXP][workflow] Remove cmake build as it not supported yet with the new SDK Signed-off-by: Martin Girardot --------- Signed-off-by: Martin Girardot Co-authored-by: Jaafar BEN YOUNES Co-authored-by: Restyled.io --- .github/workflows/examples-nxp.yaml | 3 +-- examples/thermostat/nxp/rt/rt1060/BUILD.gn | 15 +++++-------- .../nxp/common/ConnectivityManagerImpl.cpp | 11 ---------- .../nxp/common/DiagnosticDataProviderImpl.h | 8 ++----- src/platform/nxp/common/NXPConfigNVS.cpp | 3 +++ .../nxp/common/ble/BLEManagerCommon.cpp | 5 +++++ .../nxp/k32w0/KeyValueStoreManagerImpl.cpp | 20 ----------------- third_party/nxp/nxp_matter_support | 2 +- third_party/openthread/ot-nxp | 2 +- .../platforms/nxp/mcxw71_k32w1/BUILD.gn | 22 +++++++++---------- .../platforms/nxp/rt/rt1060/BUILD.gn | 4 ++++ .../platforms/nxp/rt/rt1170/BUILD.gn | 4 ++++ .../platforms/nxp/rt/rw61x/BUILD.gn | 4 ++++ 13 files changed, 41 insertions(+), 62 deletions(-) diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 45a1971baf7286..d74f01bc813ccb 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:94 + image: ghcr.io/project-chip/chip-build-nxp:96 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -203,7 +203,6 @@ jobs: scripts/run_in_build_env.sh "\ ./scripts/build/build_examples.py \ --target nxp-rw61x-freertos-all-clusters-wifi \ - --target nxp-rw61x-freertos-all-clusters-wifi-ota-cmake \ build \ --copy-artifacts-to out/artifacts \ " diff --git a/examples/thermostat/nxp/rt/rt1060/BUILD.gn b/examples/thermostat/nxp/rt/rt1060/BUILD.gn index c365ee9d47b4ca..83f9da9bc27ab1 100644 --- a/examples/thermostat/nxp/rt/rt1060/BUILD.gn +++ b/examples/thermostat/nxp/rt/rt1060/BUILD.gn @@ -212,18 +212,10 @@ rt_executable("thermostat") { } if (chip_enable_ota_requestor) { + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] sources += [ - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/flash_partitioning.h", "${common_example_dir}/ota_requestor/source/OTARequestorInitiator.cpp", "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorCommon.cpp", - - #Adding mcuboot files - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/mcuboot_app_support.c", - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support/mcuboot_app_support.h", - ] - include_dirs += [ - "$${common_example_dir}/ota_requestor/include", - "${chip_root}/examples/platform/nxp/common/mcuboot_app_support", ] } @@ -291,6 +283,9 @@ rt_executable("thermostat") { "-Wl,--no-warn-rwx-segments", ] + if (evkname == "evkcmimxrt1060") { + ldflags += [ "-Wl,--defsym=gEVKCFlashSize_d=0x1000000" ] + } if (enable_ota_provider) { # As the OTA file will be stored in the littlefs file system, it is required to increase the size of the file system # To be able to store an OTA file with a MAX size of 640K, @@ -305,7 +300,7 @@ rt_executable("thermostat") { # we would need to reserve enough space for the bootloader (MCUBoot) # MCUBoot requires 0x11000 Bytes to be reserved at the base of the flash # Consequently, some sections will need to be shifted - ldflags += [ "-Wl,--defsym=__mcu_boot_size__=0x11000" ] + ldflags += [ "-Wl,--defsym=__m_mcuboot_size__=0x40000" ] } output_dir = root_out_dir diff --git a/src/platform/nxp/common/ConnectivityManagerImpl.cpp b/src/platform/nxp/common/ConnectivityManagerImpl.cpp index 90e3f876713397..afbb10a42ab266 100644 --- a/src/platform/nxp/common/ConnectivityManagerImpl.cpp +++ b/src/platform/nxp/common/ConnectivityManagerImpl.cpp @@ -75,12 +75,6 @@ using namespace ::chip::System; using namespace ::chip::DeviceLayer::Internal; using namespace ::chip::DeviceLayer::DeviceEventType; -#if !SDK_2_16_100 -// Table 9-50 "Status codes" of IEEE 802.11-2020: Unspecified failure -// Temporary default status code before SDK API to map wlan_event_reason to IEEE Status codes -#define WLAN_REFUSED_REASON_UNSPECIFIED 1 -#endif - namespace chip { namespace DeviceLayer { @@ -244,12 +238,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent) WiFiDiagnosticsDelegate * delegate = GetDiagnosticDataProvider().GetWiFiDiagnosticsDelegate(); uint8_t associationFailureCause = chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kUnknown); - -#if SDK_2_16_100 uint16_t wlan_status_code = wlan_get_status_code(wlanEvent); -#else - uint16_t wlan_status_code = WLAN_REFUSED_REASON_UNSPECIFIED; -#endif #if CHIP_DETAIL_LOGGING enum wlan_connection_state state; diff --git a/src/platform/nxp/common/DiagnosticDataProviderImpl.h b/src/platform/nxp/common/DiagnosticDataProviderImpl.h index 2137d63d383084..c4bc245a58bd22 100644 --- a/src/platform/nxp/common/DiagnosticDataProviderImpl.h +++ b/src/platform/nxp/common/DiagnosticDataProviderImpl.h @@ -67,20 +67,16 @@ class DiagnosticDataProviderImpl : public DiagnosticDataProvider CHIP_ERROR GetWiFiPacketMulticastTxCount(uint32_t & packetMulticastTxCount) override; CHIP_ERROR GetWiFiPacketUnicastTxCount(uint32_t & packetUnicastTxCount) override; CHIP_ERROR ResetWiFiNetworkDiagnosticsCounts() override; -#if SDK_2_16_100 CHIP_ERROR GetWiFiOverrunCount(uint64_t & overrunCount) override; CHIP_ERROR GetWiFiPacketUnicastRxCount(uint32_t & packetUnicastTxCount) override; -#endif uint32_t mBeaconRxCount = 0; uint32_t mBeaconLostCount = 0; uint32_t mPacketMulticastRxCount = 0; uint32_t mPacketMulticastTxCount = 0; uint32_t mPacketUnicastTxCount = 0; -#if SDK_2_16_100 - uint32_t mPacketUnicastRxCount = 0; - uint64_t mOverrunCount = 0; -#endif + uint32_t mPacketUnicastRxCount = 0; + uint64_t mOverrunCount = 0; #endif /* CHIP_DEVICE_CONFIG_ENABLE_WPA */ }; diff --git a/src/platform/nxp/common/NXPConfigNVS.cpp b/src/platform/nxp/common/NXPConfigNVS.cpp index 6d0ce459a4187d..2256ac1e6479dc 100644 --- a/src/platform/nxp/common/NXPConfigNVS.cpp +++ b/src/platform/nxp/common/NXPConfigNVS.cpp @@ -21,7 +21,10 @@ #include #include #include + +extern "C" { #include +} /* Only for flash init, to be move to sdk framework */ #include "nvs_port.h" diff --git a/src/platform/nxp/common/ble/BLEManagerCommon.cpp b/src/platform/nxp/common/ble/BLEManagerCommon.cpp index baba33ecdab48c..8f126a086ccdb2 100644 --- a/src/platform/nxp/common/ble/BLEManagerCommon.cpp +++ b/src/platform/nxp/common/ble/BLEManagerCommon.cpp @@ -49,6 +49,11 @@ #include #endif +// Temporarily keep backwards compatibility. To be removed +#ifndef CONFIG_CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT +#define CONFIG_CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT CHIP_DEVICE_CONFIG_BLE_FAST_ADVERTISING_TIMEOUT +#endif + /******************************************************************************* * Local data types *******************************************************************************/ diff --git a/src/platform/nxp/k32w0/KeyValueStoreManagerImpl.cpp b/src/platform/nxp/k32w0/KeyValueStoreManagerImpl.cpp index 0ba86d0c4bb967..8a525b31132559 100644 --- a/src/platform/nxp/k32w0/KeyValueStoreManagerImpl.cpp +++ b/src/platform/nxp/k32w0/KeyValueStoreManagerImpl.cpp @@ -172,10 +172,6 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Get(const char * key, void * value, size_t err = GetValStorage(key)->Read(pdmInternalId, 0, (uint8_t *) value, &valueSize); *read_bytes_size = valueSize; } - else - { - ChipLogProgress(DeviceLayer, "KVS key [%s] not found in persistent storage.", key); - } exit: ConvertError(err); @@ -214,16 +210,8 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Put(const char * key, const void * value, ChipLogProgress(DeviceLayer, "KVS key: set [%s][%i][%s]", key, pdmInternalId, GetKeyStorage(key)->GetName()); err = GetKeyStorage(key)->Write(pdmInternalId, (uint8_t *) key, strlen(key) + 1); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(DeviceLayer, "KVS key: error when setting [%s][%i]", key, pdmInternalId); - } } } - else - { - ChipLogProgress(DeviceLayer, "KVS val: error when setting [%s][%i]", key, pdmInternalId); - } exit: ConvertError(err); @@ -255,14 +243,6 @@ CHIP_ERROR KeyValueStoreManagerImpl::_Delete(const char * key) ChipLogProgress(DeviceLayer, "KVS val: del [%s][%i][%s]", key, pdmInternalId, GetValStorage(key)->GetName()); err = GetValStorage(key)->Delete(pdmInternalId, -1); - if (err != CHIP_NO_ERROR) - { - ChipLogProgress(DeviceLayer, "KVS val: error when deleting [%s][%i]", key, pdmInternalId); - } - } - else - { - ChipLogProgress(DeviceLayer, "KVS key: error when deleting [%s][%i]", key, pdmInternalId); } } exit: diff --git a/third_party/nxp/nxp_matter_support b/third_party/nxp/nxp_matter_support index 2fff7067131f13..d0601f84ec6feb 160000 --- a/third_party/nxp/nxp_matter_support +++ b/third_party/nxp/nxp_matter_support @@ -1 +1 @@ -Subproject commit 2fff7067131f130c560de9fa49f247022270ca55 +Subproject commit d0601f84ec6febe57d3f5832e8f24656e7f58076 diff --git a/third_party/openthread/ot-nxp b/third_party/openthread/ot-nxp index 0a480829128901..dfbe12280af4a8 160000 --- a/third_party/openthread/ot-nxp +++ b/third_party/openthread/ot-nxp @@ -1 +1 @@ -Subproject commit 0a4808291289019d0930a6a63afd87c2983353f5 +Subproject commit dfbe12280af4a87cb9ae0c0c1d90d71de3372d82 diff --git a/third_party/openthread/platforms/nxp/mcxw71_k32w1/BUILD.gn b/third_party/openthread/platforms/nxp/mcxw71_k32w1/BUILD.gn index 5d583fdd898bef..2050591b8f4345 100644 --- a/third_party/openthread/platforms/nxp/mcxw71_k32w1/BUILD.gn +++ b/third_party/openthread/platforms/nxp/mcxw71_k32w1/BUILD.gn @@ -24,7 +24,7 @@ import("${nxp_sdk_build_root}/nxp_sdk.gni") openthread_nxp_root = "${chip_root}/third_party/openthread/ot-nxp" config("openthread_k32w1_config") { - include_dirs = [ "${openthread_nxp_root}/src/k32w1/k32w1" ] + include_dirs = [ "${openthread_nxp_root}/src/k32w1" ] defines = [ "OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE=1", @@ -59,8 +59,8 @@ config("openthread_k32w1_config") { source_set("openthread_core_config_k32w1") { sources = [ - "${openthread_nxp_root}/src/k32w1/k32w1/openthread-core-k32w1-config-check.h", - "${openthread_nxp_root}/src/k32w1/k32w1/openthread-core-k32w1-config.h", + "${openthread_nxp_root}/src/k32w1/openthread-core-k32w1-config-check.h", + "${openthread_nxp_root}/src/k32w1/openthread-core-k32w1-config.h", ] public_configs = [ ":openthread_k32w1_config" ] @@ -72,14 +72,14 @@ source_set("openthread_core_config_k32w1") { source_set("libopenthread-k32w1") { sources = [ "${openthread_nxp_root}/src/common/crypto.c", - "${openthread_nxp_root}/src/k32w1/k32w1/alarm.c", - "${openthread_nxp_root}/src/k32w1/k32w1/diag.c", - "${openthread_nxp_root}/src/k32w1/k32w1/entropy.c", - "${openthread_nxp_root}/src/k32w1/k32w1/logging.c", - "${openthread_nxp_root}/src/k32w1/k32w1/misc.c", - "${openthread_nxp_root}/src/k32w1/k32w1/radio.c", - "${openthread_nxp_root}/src/k32w1/k32w1/system.c", - "${openthread_nxp_root}/src/k32w1/k32w1/uart.c", + "${openthread_nxp_root}/src/k32w1/alarm.c", + "${openthread_nxp_root}/src/k32w1/diag.c", + "${openthread_nxp_root}/src/k32w1/entropy.c", + "${openthread_nxp_root}/src/k32w1/logging.c", + "${openthread_nxp_root}/src/k32w1/misc.c", + "${openthread_nxp_root}/src/k32w1/radio.c", + "${openthread_nxp_root}/src/k32w1/system.c", + "${openthread_nxp_root}/src/k32w1/uart.c", ] if (chip_crypto == "platform") { diff --git a/third_party/openthread/platforms/nxp/rt/rt1060/BUILD.gn b/third_party/openthread/platforms/nxp/rt/rt1060/BUILD.gn index 66640702f6d709..9af3193803f49b 100644 --- a/third_party/openthread/platforms/nxp/rt/rt1060/BUILD.gn +++ b/third_party/openthread/platforms/nxp/rt/rt1060/BUILD.gn @@ -55,6 +55,8 @@ config("openthread_rt1060_config") { "OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE=1", "OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE=1", "OT_APP_BR_LWIP_HOOKS_EN=1", + "OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE=1", + "OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE=1", ] if (nxp_enable_matter_cli) { @@ -95,10 +97,12 @@ source_set("libopenthread-rt1060") { sources += [ "${openthread_nxp_root}/src/common/br/border_agent.c", "${openthread_nxp_root}/src/common/br/br_rtos_manager.c", + "${openthread_nxp_root}/src/common/br/dns_upstream_resolver.c", "${openthread_nxp_root}/src/common/br/infra_if.c", "${openthread_nxp_root}/src/common/br/lwip_hooks.c", "${openthread_nxp_root}/src/common/br/lwip_mcast.c", "${openthread_nxp_root}/src/common/br/mdns_socket.c", + "${openthread_nxp_root}/src/common/br/trel_plat.c", "${openthread_nxp_root}/src/common/br/udp_plat.c", "${openthread_nxp_root}/src/common/br/utils.c", ] diff --git a/third_party/openthread/platforms/nxp/rt/rt1170/BUILD.gn b/third_party/openthread/platforms/nxp/rt/rt1170/BUILD.gn index 228f9e0814ec96..7e05e5607cbf94 100644 --- a/third_party/openthread/platforms/nxp/rt/rt1170/BUILD.gn +++ b/third_party/openthread/platforms/nxp/rt/rt1170/BUILD.gn @@ -54,6 +54,8 @@ config("openthread_rt1170_config") { "OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE=1", "OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE=1", "OT_APP_BR_LWIP_HOOKS_EN=1", + "OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE=1", + "OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE=1", ] if (nxp_enable_matter_cli) { @@ -93,10 +95,12 @@ source_set("libopenthread-rt1170") { sources += [ "${openthread_nxp_root}/src/common/br/border_agent.c", "${openthread_nxp_root}/src/common/br/br_rtos_manager.c", + "${openthread_nxp_root}/src/common/br/dns_upstream_resolver.c", "${openthread_nxp_root}/src/common/br/infra_if.c", "${openthread_nxp_root}/src/common/br/lwip_hooks.c", "${openthread_nxp_root}/src/common/br/lwip_mcast.c", "${openthread_nxp_root}/src/common/br/mdns_socket.c", + "${openthread_nxp_root}/src/common/br/trel_plat.c", "${openthread_nxp_root}/src/common/br/udp_plat.c", "${openthread_nxp_root}/src/common/br/utils.c", ] diff --git a/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn b/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn index 1dbfe5e5a5f2c6..a4eca99214fbe0 100644 --- a/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn +++ b/third_party/openthread/platforms/nxp/rt/rw61x/BUILD.gn @@ -56,7 +56,9 @@ config("openthread_rw61x_config") { "OPENTHREAD_CONFIG_DNSSD_DISCOVERY_PROXY_ENABLE=1", "OPENTHREAD_CONFIG_MULTICAST_DNS_ENABLE=1", "OPENTHREAD_CONFIG_MULTICAST_DNS_PUBLIC_API_ENABLE=1", + "OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE=1", "OT_APP_BR_LWIP_HOOKS_EN=1", + "OPENTHREAD_CONFIG_DNS_UPSTREAM_QUERY_ENABLE=1", ] if (nxp_enable_matter_cli) { @@ -91,10 +93,12 @@ source_set("libopenthread-rw61x") { sources += [ "${openthread_nxp_root}/src/common/br/border_agent.c", "${openthread_nxp_root}/src/common/br/br_rtos_manager.c", + "${openthread_nxp_root}/src/common/br/dns_upstream_resolver.c", "${openthread_nxp_root}/src/common/br/infra_if.c", "${openthread_nxp_root}/src/common/br/lwip_hooks.c", "${openthread_nxp_root}/src/common/br/lwip_mcast.c", "${openthread_nxp_root}/src/common/br/mdns_socket.c", + "${openthread_nxp_root}/src/common/br/trel_plat.c", "${openthread_nxp_root}/src/common/br/udp_plat.c", "${openthread_nxp_root}/src/common/br/utils.c", ]