From 83e098c90c3a55572bec46e4c735dd6f29eb3a2e Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:13:09 +0300 Subject: [PATCH 01/16] [nxp][platform][common] Rename S200 crypto PAL and move it to common Signed-off-by: marius-alex-tache --- .../crypto/CHIPCryptoPalS200.cpp} | 2 +- .../PersistentStorageOpKeystoreS200.cpp} | 20 +++++++++---------- .../crypto/PersistentStorageOpKeystoreS200.h} | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) rename src/platform/nxp/{mcxw71_k32w1/CHIPCryptoPalK32W1.cpp => common/crypto/CHIPCryptoPalS200.cpp} (99%) rename src/platform/nxp/{mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp => common/crypto/PersistentStorageOpKeystoreS200.cpp} (91%) rename src/platform/nxp/{mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h => common/crypto/PersistentStorageOpKeystoreS200.h} (93%) diff --git a/src/platform/nxp/mcxw71_k32w1/CHIPCryptoPalK32W1.cpp b/src/platform/nxp/common/crypto/CHIPCryptoPalS200.cpp similarity index 99% rename from src/platform/nxp/mcxw71_k32w1/CHIPCryptoPalK32W1.cpp rename to src/platform/nxp/common/crypto/CHIPCryptoPalS200.cpp index 9506d1bdfe1cc3..6e9342658c7ddd 100644 --- a/src/platform/nxp/mcxw71_k32w1/CHIPCryptoPalK32W1.cpp +++ b/src/platform/nxp/common/crypto/CHIPCryptoPalS200.cpp @@ -17,7 +17,7 @@ /** * @file - * mbedTLS based implementation of CHIP crypto primitives + * mbedTLS and S200 based implementation of CHIP crypto primitives */ #include diff --git a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp similarity index 91% rename from src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp rename to src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp index a3a4a480430979..fc3c580974ba03 100644 --- a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp +++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp @@ -29,7 +29,7 @@ #include #include -#include "K32W1PersistentStorageOpKeystore.h" +#include "PersistentStorageOpKeystoreS200.h" #include "sss_crypto.h" @@ -82,7 +82,7 @@ CHIP_ERROR P256KeypairSSS::ImportBlob(P256SerializedKeypairSSS & input) return CHIP_NO_ERROR; } -bool K32W1PersistentStorageOpKeystore::HasOpKeypairForFabric(FabricIndex fabricIndex) const +bool PersistentStorageOpKeystoreS200::HasOpKeypairForFabric(FabricIndex fabricIndex) const { VerifyOrReturnError(mStorage != nullptr, false); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), false); @@ -102,7 +102,7 @@ bool K32W1PersistentStorageOpKeystore::HasOpKeypairForFabric(FabricIndex fabricI return (err == CHIP_NO_ERROR && (keySize == SSS_KEY_PAIR_BLOB_SIZE)); } -CHIP_ERROR K32W1PersistentStorageOpKeystore::NewOpKeypairForFabric(FabricIndex fabricIndex, +CHIP_ERROR PersistentStorageOpKeystoreS200::NewOpKeypairForFabric(FabricIndex fabricIndex, MutableByteSpan & outCertificateSigningRequest) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); @@ -135,7 +135,7 @@ CHIP_ERROR K32W1PersistentStorageOpKeystore::NewOpKeypairForFabric(FabricIndex f return CHIP_NO_ERROR; } -CHIP_ERROR K32W1PersistentStorageOpKeystore::ActivateOpKeypairForFabric(FabricIndex fabricIndex, +CHIP_ERROR PersistentStorageOpKeystoreS200::ActivateOpKeypairForFabric(FabricIndex fabricIndex, const Crypto::P256PublicKey & nocPublicKey) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); @@ -149,7 +149,7 @@ CHIP_ERROR K32W1PersistentStorageOpKeystore::ActivateOpKeypairForFabric(FabricIn return CHIP_NO_ERROR; } -CHIP_ERROR K32W1PersistentStorageOpKeystore::CommitOpKeypairForFabric(FabricIndex fabricIndex) +CHIP_ERROR PersistentStorageOpKeystoreS200::CommitOpKeypairForFabric(FabricIndex fabricIndex) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); @@ -168,7 +168,7 @@ CHIP_ERROR K32W1PersistentStorageOpKeystore::CommitOpKeypairForFabric(FabricInde return CHIP_NO_ERROR; } -CHIP_ERROR K32W1PersistentStorageOpKeystore::RemoveOpKeypairForFabric(FabricIndex fabricIndex) +CHIP_ERROR PersistentStorageOpKeystoreS200::RemoveOpKeypairForFabric(FabricIndex fabricIndex) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); @@ -188,7 +188,7 @@ CHIP_ERROR K32W1PersistentStorageOpKeystore::RemoveOpKeypairForFabric(FabricInde return err; } -void K32W1PersistentStorageOpKeystore::RevertPendingKeypair() +void PersistentStorageOpKeystoreS200::RevertPendingKeypair() { VerifyOrReturn(mStorage != nullptr); @@ -196,7 +196,7 @@ void K32W1PersistentStorageOpKeystore::RevertPendingKeypair() ResetPendingKey(); } -CHIP_ERROR K32W1PersistentStorageOpKeystore::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, +CHIP_ERROR PersistentStorageOpKeystoreS200::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, Crypto::P256ECDSASignature & outSignature) const { CHIP_ERROR error = CHIP_NO_ERROR; @@ -239,7 +239,7 @@ CHIP_ERROR K32W1PersistentStorageOpKeystore::SignWithOpKeypair(FabricIndex fabri return mCachedKeypair->ECDSA_sign_msg(message.data(), message.size(), outSignature); } -Crypto::P256Keypair * K32W1PersistentStorageOpKeystore::AllocateEphemeralKeypairForCASE() +Crypto::P256Keypair * PersistentStorageOpKeystoreS200::AllocateEphemeralKeypairForCASE() { // DO NOT CUT AND PASTE without considering the ReleaseEphemeralKeypair(). // If allocating a derived class, then `ReleaseEphemeralKeypair` MUST @@ -247,7 +247,7 @@ Crypto::P256Keypair * K32W1PersistentStorageOpKeystore::AllocateEphemeralKeypair return Platform::New(); } -void K32W1PersistentStorageOpKeystore::ReleaseEphemeralKeypair(Crypto::P256Keypair * keypair) +void PersistentStorageOpKeystoreS200::ReleaseEphemeralKeypair(Crypto::P256Keypair * keypair) { // DO NOT CUT AND PASTE without considering the AllocateEphemeralKeypairForCASE(). // This must delete the same concrete class as allocated in `AllocateEphemeralKeypairForCASE` diff --git a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h similarity index 93% rename from src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h rename to src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h index c0aeabccd2e724..4319a619701998 100644 --- a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h +++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h @@ -61,15 +61,15 @@ class P256KeypairSSS : public Crypto::P256Keypair * of how to use the interface. * */ -class K32W1PersistentStorageOpKeystore : public Crypto::OperationalKeystore +class PersistentStorageOpKeystoreS200 : public Crypto::OperationalKeystore { public: - K32W1PersistentStorageOpKeystore() = default; - virtual ~K32W1PersistentStorageOpKeystore() { Finish(); } + PersistentStorageOpKeystoreS200() = default; + virtual ~PersistentStorageOpKeystoreS200() { Finish(); } // Non-copyable - K32W1PersistentStorageOpKeystore(K32W1PersistentStorageOpKeystore const &) = delete; - void operator=(K32W1PersistentStorageOpKeystore const &) = delete; + PersistentStorageOpKeystoreS200(PersistentStorageOpKeystoreS200 const &) = delete; + void operator=(PersistentStorageOpKeystoreS200 const &) = delete; /** * @brief Initialize the Operational Keystore to map to a given storage delegate. From 9b9a140001f9ce67a3419b4b3de4c65e3ca386a0 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:17:42 +0300 Subject: [PATCH 02/16] [nxp][examples][common] Make S200 Operational Keystore common Signed-off-by: marius-alex-tache --- .../source/OperationalKeystoreS200.cpp} | 4 ++-- .../nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp | 6 +++--- .../nxp/common/crypto/PersistentStorageOpKeystoreS200.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename examples/platform/nxp/{mcxw71_k32w1/operational_keystore/OperationalKeystore.cpp => common/operational_keystore/source/OperationalKeystoreS200.cpp} (88%) diff --git a/examples/platform/nxp/mcxw71_k32w1/operational_keystore/OperationalKeystore.cpp b/examples/platform/nxp/common/operational_keystore/source/OperationalKeystoreS200.cpp similarity index 88% rename from examples/platform/nxp/mcxw71_k32w1/operational_keystore/OperationalKeystore.cpp rename to examples/platform/nxp/common/operational_keystore/source/OperationalKeystoreS200.cpp index ecd72266178984..04f89e4c814f43 100644 --- a/examples/platform/nxp/mcxw71_k32w1/operational_keystore/OperationalKeystore.cpp +++ b/examples/platform/nxp/common/operational_keystore/source/OperationalKeystoreS200.cpp @@ -16,9 +16,9 @@ */ #include "OperationalKeystore.h" -#include "K32W1PersistentStorageOpKeystore.h" +#include -static chip::K32W1PersistentStorageOpKeystore sInstance; +static chip::PersistentStorageOpKeystoreS200 sInstance; chip::Crypto::OperationalKeystore * chip::NXP::App::OperationalKeystore::GetInstance() { diff --git a/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp index fc3c580974ba03..09744d2ce51d15 100644 --- a/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp +++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp @@ -103,7 +103,7 @@ bool PersistentStorageOpKeystoreS200::HasOpKeypairForFabric(FabricIndex fabricIn } CHIP_ERROR PersistentStorageOpKeystoreS200::NewOpKeypairForFabric(FabricIndex fabricIndex, - MutableByteSpan & outCertificateSigningRequest) + MutableByteSpan & outCertificateSigningRequest) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); @@ -136,7 +136,7 @@ CHIP_ERROR PersistentStorageOpKeystoreS200::NewOpKeypairForFabric(FabricIndex fa } CHIP_ERROR PersistentStorageOpKeystoreS200::ActivateOpKeypairForFabric(FabricIndex fabricIndex, - const Crypto::P256PublicKey & nocPublicKey) + const Crypto::P256PublicKey & nocPublicKey) { VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX); @@ -197,7 +197,7 @@ void PersistentStorageOpKeystoreS200::RevertPendingKeypair() } CHIP_ERROR PersistentStorageOpKeystoreS200::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message, - Crypto::P256ECDSASignature & outSignature) const + Crypto::P256ECDSASignature & outSignature) const { CHIP_ERROR error = CHIP_NO_ERROR; diff --git a/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h index 4319a619701998..12edb9d8412cc0 100644 --- a/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h +++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h @@ -69,7 +69,7 @@ class PersistentStorageOpKeystoreS200 : public Crypto::OperationalKeystore // Non-copyable PersistentStorageOpKeystoreS200(PersistentStorageOpKeystoreS200 const &) = delete; - void operator=(PersistentStorageOpKeystoreS200 const &) = delete; + void operator=(PersistentStorageOpKeystoreS200 const &) = delete; /** * @brief Initialize the Operational Keystore to map to a given storage delegate. From 3ca9f80af298f0bc898eb9e062744e70bc327ede Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:37:00 +0300 Subject: [PATCH 03/16] [nxp][platform][common] Make k32w1 BLEManager implementation common This can be reused by other platforms as long as they are using the same SDK. Signed-off-by: marius-alex-tache --- .../{legacy => ble}/BLEManagerCommon.cpp | 2 +- .../common/{legacy => ble}/BLEManagerCommon.h | 2 +- .../ble}/BLEManagerImpl.cpp | 7 +- src/platform/nxp/common/legacy/gatt_db.h | 30 ------ src/platform/nxp/common/legacy/gatt_uuid128.h | 26 ----- .../nxp/mcxw71_k32w1/ble_function_mux.c | 94 ------------------- .../nxp/mcxw71_k32w1/ble_function_mux.h | 34 ------- 7 files changed, 8 insertions(+), 187 deletions(-) rename src/platform/nxp/common/{legacy => ble}/BLEManagerCommon.cpp (99%) rename src/platform/nxp/common/{legacy => ble}/BLEManagerCommon.h (99%) rename src/platform/nxp/{mcxw71_k32w1 => common/ble}/BLEManagerImpl.cpp (92%) delete mode 100644 src/platform/nxp/common/legacy/gatt_db.h delete mode 100644 src/platform/nxp/common/legacy/gatt_uuid128.h delete mode 100644 src/platform/nxp/mcxw71_k32w1/ble_function_mux.c delete mode 100644 src/platform/nxp/mcxw71_k32w1/ble_function_mux.h diff --git a/src/platform/nxp/common/legacy/BLEManagerCommon.cpp b/src/platform/nxp/common/ble/BLEManagerCommon.cpp similarity index 99% rename from src/platform/nxp/common/legacy/BLEManagerCommon.cpp rename to src/platform/nxp/common/ble/BLEManagerCommon.cpp index d9dbde88f3a614..02871e31f71058 100644 --- a/src/platform/nxp/common/legacy/BLEManagerCommon.cpp +++ b/src/platform/nxp/common/ble/BLEManagerCommon.cpp @@ -20,7 +20,7 @@ /** * @file * Provides an implementation of the BLEManager singleton object - * for the K32W platforms. + * for NXP platforms. */ /* this file behaves like a config.h, comes first */ diff --git a/src/platform/nxp/common/legacy/BLEManagerCommon.h b/src/platform/nxp/common/ble/BLEManagerCommon.h similarity index 99% rename from src/platform/nxp/common/legacy/BLEManagerCommon.h rename to src/platform/nxp/common/ble/BLEManagerCommon.h index b7fc1275d2501f..780ee194b8b28f 100644 --- a/src/platform/nxp/common/legacy/BLEManagerCommon.h +++ b/src/platform/nxp/common/ble/BLEManagerCommon.h @@ -20,7 +20,7 @@ /** * @file * Provides an implementation of the BLEManager singleton object - * for the K32W platforms. + * for NXP platforms. */ #pragma once diff --git a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.cpp b/src/platform/nxp/common/ble/BLEManagerImpl.cpp similarity index 92% rename from src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.cpp rename to src/platform/nxp/common/ble/BLEManagerImpl.cpp index 1eefdf5ef16ffc..e8ac5e96a7da13 100644 --- a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.cpp +++ b/src/platform/nxp/common/ble/BLEManagerImpl.cpp @@ -28,7 +28,12 @@ messaging_t gHci2Host_TaskQueue; /*! Event for the Host Task Queue */ OSA_EVENT_HANDLE_DEFINE(gHost_TaskEvent); -#include +#ifdef EXTERNAL_BLEMANAGERIMPL_HEADER +#include EXTERNAL_BLEMANAGERIMPL_HEADER +#elif defined(CHIP_DEVICE_LAYER_TARGET) +#define BLEMANAGERIMPL_HEADER +#include BLEMANAGERIMPL_HEADER +#endif // defined(CHIP_DEVICE_LAYER_TARGET) extern "C" bleResult_t Hci_Reset(void); diff --git a/src/platform/nxp/common/legacy/gatt_db.h b/src/platform/nxp/common/legacy/gatt_db.h deleted file mode 100644 index 604fcfb61a7ba1..00000000000000 --- a/src/platform/nxp/common/legacy/gatt_db.h +++ /dev/null @@ -1,30 +0,0 @@ -PRIMARY_SERVICE(service_gatt, gBleSig_GenericAttributeProfile_d) -CHARACTERISTIC(char_service_changed, gBleSig_GattServiceChanged_d, (gGattCharPropRead_c | gGattCharPropNotify_c)) -VALUE(value_service_changed, gBleSig_GattServiceChanged_d, (gPermissionNone_c), 4, 0x00, 0x00, 0x00, 0x00) -CCCD(cccd_service_changed) - -PRIMARY_SERVICE(service_gap, gBleSig_GenericAccessProfile_d) -CHARACTERISTIC(char_device_name, gBleSig_GapDeviceName_d, (gGattCharPropRead_c)) -VALUE(value_device_name, gBleSig_GapDeviceName_d, (gPermissionFlagReadable_c), 16, "NXP_ELOCK_DEMO") -CHARACTERISTIC(char_appearance, gBleSig_GapAppearance_d, (gGattCharPropRead_c)) -VALUE(value_appearance, gBleSig_GapAppearance_d, (gPermissionFlagReadable_c), 2, 0x00, 0x00) - -PRIMARY_SERVICE(service_chipoble, gChipoBleService_d) -CHARACTERISTIC_UUID128(chipoble_rx, uuid_chipoble_rx, (gGattCharPropWrite_c)) -VALUE_UUID128_VARLEN(value_chipoble_rx, uuid_chipoble_rx, (gPermissionFlagWritable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) -CHARACTERISTIC_UUID128(chipoble_tx, uuid_chipoble_tx, (gGattCharPropIndicate_c | gGattCharPropRead_c)) -VALUE_UUID128_VARLEN(value_chipoble_tx, uuid_chipoble_tx, (gPermissionFlagReadable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) -CCCD(cccd_chipoble_tx) -CHARACTERISTIC_UUID128(chipoble_c3, uuid_chipoble_c3, (gGattCharPropRead_c)) -VALUE_UUID128_VARLEN(value_chipoble_c3, uuid_chipoble_c3, (gPermissionFlagReadable_c), gAttMaxReadDataSize_d(gAttMaxValueLength_c), - gAttMaxReadDataSize_d(gAttMaxValueLength_c), 0x00) - -PRIMARY_SERVICE(service_device_info, gBleSig_DeviceInformationService_d) -CHARACTERISTIC(char_model_no, gBleSig_ModelNumberString_d, (gGattCharPropRead_c)) -VALUE(value_model_no, gBleSig_ModelNumberString_d, (gPermissionFlagReadable_c), 15, "Chip ELock Demo") -CHARACTERISTIC(char_serial_no, gBleSig_SerialNumberString_d, (gGattCharPropRead_c)) -VALUE(value_serial_no, gBleSig_SerialNumberString_d, (gPermissionFlagReadable_c), 7, "BLESN01") -CHARACTERISTIC(char_fw_rev, gBleSig_FirmwareRevisionString_d, (gGattCharPropRead_c)) -VALUE(value_fw_rev, gBleSig_FirmwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.1") -CHARACTERISTIC(char_sw_rev, gBleSig_SoftwareRevisionString_d, (gGattCharPropRead_c)) -VALUE(value_sw_rev, gBleSig_SoftwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.4") diff --git a/src/platform/nxp/common/legacy/gatt_uuid128.h b/src/platform/nxp/common/legacy/gatt_uuid128.h deleted file mode 100644 index 938968b1943ce2..00000000000000 --- a/src/platform/nxp/common/legacy/gatt_uuid128.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Declare all custom 128-bit UUIDs here using the format: -* -* UUID128(name, bytes) -* -* where: -* -name : an unique tag for the newly defined UUID; - will be used to reference this UUID when defining - services and characteristics in <> -* -bytes: 16 bytes representing the 128-bit value -* -* One definition per line. No semicolon required after each definition. -* -* example: -* UUID128(uuid_service_robot_characteristics, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, -0xCD, 0xEF) -* UUID128(uuid_char_robot_direction, 0x12, 0x34, 0x50, 0x00, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, -0xEF) -*/ -/* Services */ - -#define gChipoBleService_d 0xFFF6 - -UUID128(uuid_chipoble_tx, 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) -UUID128(uuid_chipoble_rx, 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) -UUID128(uuid_chipoble_c3, 0x04, 0x8f, 0x21, 0x83, 0x8a, 0x74, 0x7d, 0xb8, 0xf2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64) diff --git a/src/platform/nxp/mcxw71_k32w1/ble_function_mux.c b/src/platform/nxp/mcxw71_k32w1/ble_function_mux.c deleted file mode 100644 index ed3a643b8bdb9b..00000000000000 --- a/src/platform/nxp/mcxw71_k32w1/ble_function_mux.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Copyright (c) 2021 Project CHIP Authors - * Copyright (c) 2020 Nest Labs, Inc. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation for BLE Host NVM functions - */ -#include "assert.h" -#include "ble_constants.h" -#include "fsl_os_abstraction.h" -#include "gap_interface.h" -#include "gatt_database.h" - -#include "ble_constants.h" -#include "gatt_db_dynamic.h" - -#include "ble_function_mux.h" - -/* Security Manager */ -#define smpEdiv 0x1F99 -#define mcEncryptionKeySize_c 16 - -/* LTK */ -static uint8_t smpLtk[gcSmpMaxLtkSize_c] = { 0xD6, 0x93, 0xE8, 0xA4, 0x23, 0x55, 0x48, 0x99, - 0x1D, 0x77, 0x61, 0xE6, 0x63, 0x2B, 0x10, 0x8E }; - -/* RAND*/ -static uint8_t smpRand[gcSmpMaxRandSize_c] = { 0x26, 0x1E, 0xF6, 0x09, 0x97, 0x2E, 0xAD, 0x7E }; - -/* IRK */ -static uint8_t smpIrk[gcSmpIrkSize_c] = { 0x0A, 0x2D, 0xF4, 0x65, 0xE3, 0xBD, 0x7B, 0x49, - 0x1E, 0xB4, 0xC0, 0x95, 0x95, 0x13, 0x46, 0x73 }; - -/* CSRK */ -static uint8_t smpCsrk[gcSmpCsrkSize_c] = { 0x90, 0xD5, 0x06, 0x95, 0x92, 0xED, 0x91, 0xD7, - 0xA8, 0x9E, 0x2C, 0xDC, 0x4A, 0x93, 0x5B, 0xF9 }; - -gapSmpKeys_t gSmpKeys = { - .cLtkSize = mcEncryptionKeySize_c, - .aLtk = (void *) smpLtk, - .aIrk = (void *) smpIrk, - .aCsrk = (void *) smpCsrk, - .aRand = (void *) smpRand, - .cRandSize = gcSmpMaxRandSize_c, - .ediv = smpEdiv, -}; - -/******************************************************************************* - * Functions needed by the BLE stack - ******************************************************************************/ -void App_NvmRead(uint8_t mEntryIdx, void * pBondHeader, void * pBondDataDynamic, void * pBondDataStatic, void * pBondDataDeviceInfo, - void * pBondDataDescriptor, uint8_t mDescriptorIndex) -{ - NOT_USED(mEntryIdx); - NOT_USED(pBondHeader); - NOT_USED(pBondDataDynamic); - NOT_USED(pBondDataStatic); - NOT_USED(pBondDataDeviceInfo); - NOT_USED(pBondDataDescriptor); - NOT_USED(mDescriptorIndex); -} - -void App_NvmWrite(uint8_t mEntryIdx, void * pBondHeader, void * pBondDataDynamic, void * pBondDataStatic, - void * pBondDataDeviceInfo, void * pBondDataDescriptor, uint8_t mDescriptorIndex) -{ - NOT_USED(mEntryIdx); - NOT_USED(pBondHeader); - NOT_USED(pBondDataDynamic); - NOT_USED(pBondDataStatic); - NOT_USED(pBondDataDeviceInfo); - NOT_USED(pBondDataDescriptor); - NOT_USED(mDescriptorIndex); -} - -void App_NvmErase(uint8_t mEntryIdx) -{ - NOT_USED(mEntryIdx); -} diff --git a/src/platform/nxp/mcxw71_k32w1/ble_function_mux.h b/src/platform/nxp/mcxw71_k32w1/ble_function_mux.h deleted file mode 100644 index 8b9417d8b54e13..00000000000000 --- a/src/platform/nxp/mcxw71_k32w1/ble_function_mux.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Copyright (c) 2020 Project CHIP Authors - * Copyright (c) 2020 Nest Labs, Inc. - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * Provides an implementation for BLE Host NVM functions - */ - -#ifndef BLE_FUNCTION_MUX_H -#define BLE_FUNCTION_MUX_H - -typedef enum -{ - kBleFuncMux_AppMode_None, - kBleFuncMux_AppMode_Ota -} ble_func_mux_app_mode_t; - -#endif From c705cd5cc74fcf3402e1af8857c3a4147ff9ac19 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:46:45 +0300 Subject: [PATCH 04/16] [nxp][platform][common] Move OTA related files to a common folder OTAFirmwareProcessor and OTAHooks could be reused by other platforms as long as the SDK is the same, so moving them from k32w1 folder. Signed-off-by: marius-alex-tache --- .../OTAFactoryDataProcessor.cpp | 2 +- .../{legacy => ota}/OTAFactoryDataProcessor.h | 6 ++--- .../ota}/OTAFirmwareProcessor.cpp | 4 +-- .../ota}/OTAFirmwareProcessor.h | 2 +- .../{mcxw71_k32w1 => common/ota}/OTAHooks.cpp | 26 +++++++++---------- .../{legacy => ota}/OTAImageProcessorImpl.cpp | 2 +- .../{legacy => ota}/OTAImageProcessorImpl.h | 2 +- .../{legacy => ota}/OTATlvProcessor.cpp | 4 +-- .../common/{legacy => ota}/OTATlvProcessor.h | 0 .../{legacy/OTA_README.md => ota/README.md} | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) rename src/platform/nxp/common/{legacy => ota}/OTAFactoryDataProcessor.cpp (98%) rename src/platform/nxp/common/{legacy => ota}/OTAFactoryDataProcessor.h (92%) rename src/platform/nxp/{mcxw71_k32w1 => common/ota}/OTAFirmwareProcessor.cpp (96%) rename src/platform/nxp/{mcxw71_k32w1 => common/ota}/OTAFirmwareProcessor.h (96%) rename src/platform/nxp/{mcxw71_k32w1 => common/ota}/OTAHooks.cpp (85%) rename src/platform/nxp/common/{legacy => ota}/OTAImageProcessorImpl.cpp (99%) rename src/platform/nxp/common/{legacy => ota}/OTAImageProcessorImpl.h (98%) rename src/platform/nxp/common/{legacy => ota}/OTATlvProcessor.cpp (97%) rename src/platform/nxp/common/{legacy => ota}/OTATlvProcessor.h (100%) rename src/platform/nxp/common/{legacy/OTA_README.md => ota/README.md} (99%) diff --git a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.cpp b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.cpp similarity index 98% rename from src/platform/nxp/common/legacy/OTAFactoryDataProcessor.cpp rename to src/platform/nxp/common/ota/OTAFactoryDataProcessor.cpp index 4960ca2c4e0669..421f0203621add 100644 --- a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.cpp +++ b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include namespace chip { diff --git a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.h similarity index 92% rename from src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h rename to src/platform/nxp/common/ota/OTAFactoryDataProcessor.h index 862aad2d9a6341..570a33ceed5924 100644 --- a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h +++ b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.h @@ -21,9 +21,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include PLATFORM_FACTORY_DATA_PROVIDER_IMPL_HEADER namespace chip { diff --git a/src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.cpp b/src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp similarity index 96% rename from src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.cpp rename to src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp index 2ea4d47cc655a1..15aa5f271c3ccc 100644 --- a/src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.cpp +++ b/src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include #include "OtaSupport.h" diff --git a/src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.h b/src/platform/nxp/common/ota/OTAFirmwareProcessor.h similarity index 96% rename from src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.h rename to src/platform/nxp/common/ota/OTAFirmwareProcessor.h index b8bb3abd008e7a..1d17e352a4bbf5 100644 --- a/src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.h +++ b/src/platform/nxp/common/ota/OTAFirmwareProcessor.h @@ -20,7 +20,7 @@ #include "OtaPrivate.h" #include -#include +#include /* Posted Operations Size Info */ #define NB_PENDING_TRANSACTIONS 12 diff --git a/src/platform/nxp/mcxw71_k32w1/OTAHooks.cpp b/src/platform/nxp/common/ota/OTAHooks.cpp similarity index 85% rename from src/platform/nxp/mcxw71_k32w1/OTAHooks.cpp rename to src/platform/nxp/common/ota/OTAHooks.cpp index c476e705fd67be..032fe3d2ff9c4b 100644 --- a/src/platform/nxp/mcxw71_k32w1/OTAHooks.cpp +++ b/src/platform/nxp/common/ota/OTAHooks.cpp @@ -16,25 +16,25 @@ * limitations under the License. */ -#include +#include #include #include -#include +#include #if CONFIG_CHIP_OTA_FACTORY_DATA_PROCESSOR -#include -#include +#include +#include #endif // CONFIG_CHIP_OTA_FACTORY_DATA_PROCESSOR #include "OtaSupport.h" -#ifndef CONFIG_CHIP_K32W1_MAX_ENTRIES_TEST -#define CONFIG_CHIP_K32W1_MAX_ENTRIES_TEST 0 +#ifndef CONFIG_CHIP_MAX_ENTRIES_TEST +#define CONFIG_CHIP_MAX_ENTRIES_TEST 0 #endif -#ifndef CONFIG_CHIP_K32W1_OTA_ABORT_HOOK -#define CONFIG_CHIP_K32W1_OTA_ABORT_HOOK 0 +#ifndef CONFIG_CHIP_OTA_ABORT_HOOK +#define CONFIG_CHIP_OTA_ABORT_HOOK 0 #endif #define APPLICATION_PROCESSOR_TAG 1 @@ -61,7 +61,7 @@ CHIP_ERROR ProcessDescriptor(void * descriptor) extern "C" WEAK CHIP_ERROR OtaHookInit() { -#if CONFIG_CHIP_K32W1_MAX_ENTRIES_TEST +#if CONFIG_CHIP_MAX_ENTRIES_TEST static chip::OTAFirmwareProcessor processors[8]; #endif @@ -77,13 +77,13 @@ extern "C" WEAK CHIP_ERROR OtaHookInit() ReturnErrorOnFailure(imageProcessor.RegisterProcessor(FACTORY_DATA_PROCESSOR_TAG, &sFactoryDataProcessor)); #endif // CONFIG_CHIP_OTA_FACTORY_DATA_PROCESSOR -#if CONFIG_CHIP_K32W1_MAX_ENTRIES_TEST +#if CONFIG_CHIP_MAX_ENTRIES_TEST for (auto i = 0; i < 8; i++) { processors[i].RegisterDescriptorCallback(ProcessDescriptor); ReturnErrorOnFailure(imageProcessor.RegisterProcessor(i + 4, &processors[i])); } -#endif // CONFIG_CHIP_K32W1_MAX_ENTRIES_TEST +#endif // CONFIG_CHIP_MAX_ENTRIES_TEST return CHIP_NO_ERROR; } @@ -106,10 +106,10 @@ extern "C" WEAK void OtaHookAbort() Disclaimer: This is not default behavior and it was not checked against Matter specification compliance. You should use this at your own discretion. - Use CONFIG_CHIP_K32W1_OTA_ABORT_HOOK to enable/disable this feature (disabled by default). + Use CONFIG_CHIP_OTA_ABORT_HOOK to enable/disable this feature (disabled by default). This hook is called inside OTAImageProcessorImpl::HandleAbort to schedule a retry (when enabled). */ -#if CONFIG_CHIP_K32W1_OTA_ABORT_HOOK +#if CONFIG_CHIP_OTA_ABORT_HOOK auto & imageProcessor = chip::OTAImageProcessorImpl::GetDefaultInstance(); auto & providerLocation = imageProcessor.GetBackupProvider(); diff --git a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp b/src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp similarity index 99% rename from src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp rename to src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp index c26a7da59b9483..f6f42367329e54 100644 --- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp +++ b/src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include using namespace chip::DeviceLayer; using namespace ::chip::DeviceLayer::Internal; diff --git a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h b/src/platform/nxp/common/ota/OTAImageProcessorImpl.h similarity index 98% rename from src/platform/nxp/common/legacy/OTAImageProcessorImpl.h rename to src/platform/nxp/common/ota/OTAImageProcessorImpl.h index 9a862a716b957f..3419cbd6e2a9f1 100644 --- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h +++ b/src/platform/nxp/common/ota/OTAImageProcessorImpl.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/src/platform/nxp/common/legacy/OTATlvProcessor.cpp b/src/platform/nxp/common/ota/OTATlvProcessor.cpp similarity index 97% rename from src/platform/nxp/common/legacy/OTATlvProcessor.cpp rename to src/platform/nxp/common/ota/OTATlvProcessor.cpp index e50da13cecdd31..66a080135b42db 100644 --- a/src/platform/nxp/common/legacy/OTATlvProcessor.cpp +++ b/src/platform/nxp/common/ota/OTATlvProcessor.cpp @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #if OTA_ENCRYPTION_ENABLE #include "OtaUtils.h" #include "rom_aes.h" diff --git a/src/platform/nxp/common/legacy/OTATlvProcessor.h b/src/platform/nxp/common/ota/OTATlvProcessor.h similarity index 100% rename from src/platform/nxp/common/legacy/OTATlvProcessor.h rename to src/platform/nxp/common/ota/OTATlvProcessor.h diff --git a/src/platform/nxp/common/legacy/OTA_README.md b/src/platform/nxp/common/ota/README.md similarity index 99% rename from src/platform/nxp/common/legacy/OTA_README.md rename to src/platform/nxp/common/ota/README.md index 0c9715b4610ff8..e288e6ab412c18 100644 --- a/src/platform/nxp/common/legacy/OTA_README.md +++ b/src/platform/nxp/common/ota/README.md @@ -1,4 +1,4 @@ -# K32W OTA +# Multi-image OTA The OTA processing is now delegated to instances of `OTATlvProcessor` derived classes. These instances are registered with the `OTAImageProcessorImpl` From ad538479334fa90d13eaf4c6abc777aa4a2fdfda Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:50:07 +0300 Subject: [PATCH 05/16] [nxp][platform][common] Move Factory Data provider into a common folder Some components were implemented for k32w1, but can be reused as long as the used SDK is the same. Moving them to factory_data/legacy until synchronizing with the other factory data implementation. Signed-off-by: marius-alex-tache --- .../common/{ => factory_data}/legacy/FactoryDataDriver.cpp | 4 ++-- .../nxp/common/{ => factory_data}/legacy/FactoryDataDriver.h | 0 .../factory_data/legacy}/FactoryDataDriverImpl.cpp | 4 ++-- .../factory_data/legacy}/FactoryDataDriverImpl.h | 4 ++-- .../common/{ => factory_data}/legacy/FactoryDataProvider.cpp | 2 +- .../common/{ => factory_data}/legacy/FactoryDataProvider.h | 2 +- .../factory_data/legacy}/FactoryDataProviderImpl.cpp | 2 +- .../factory_data/legacy}/FactoryDataProviderImpl.h | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename src/platform/nxp/common/{ => factory_data}/legacy/FactoryDataDriver.cpp (94%) rename src/platform/nxp/common/{ => factory_data}/legacy/FactoryDataDriver.h (100%) rename src/platform/nxp/{mcxw71_k32w1 => common/factory_data/legacy}/FactoryDataDriverImpl.cpp (96%) rename src/platform/nxp/{mcxw71_k32w1 => common/factory_data/legacy}/FactoryDataDriverImpl.h (92%) rename src/platform/nxp/common/{ => factory_data}/legacy/FactoryDataProvider.cpp (99%) rename src/platform/nxp/common/{ => factory_data}/legacy/FactoryDataProvider.h (98%) rename src/platform/nxp/{mcxw71_k32w1 => common/factory_data/legacy}/FactoryDataProviderImpl.cpp (99%) rename src/platform/nxp/{mcxw71_k32w1 => common/factory_data/legacy}/FactoryDataProviderImpl.h (98%) diff --git a/src/platform/nxp/common/legacy/FactoryDataDriver.cpp b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.cpp similarity index 94% rename from src/platform/nxp/common/legacy/FactoryDataDriver.cpp rename to src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.cpp index 6ddbedc3ca35c8..f54406cfa1cc58 100644 --- a/src/platform/nxp/common/legacy/FactoryDataDriver.cpp +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.cpp @@ -17,8 +17,8 @@ #include #include -#include -#include +#include +#include namespace chip { namespace DeviceLayer { diff --git a/src/platform/nxp/common/legacy/FactoryDataDriver.h b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.h similarity index 100% rename from src/platform/nxp/common/legacy/FactoryDataDriver.h rename to src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.h diff --git a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.cpp b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.cpp similarity index 96% rename from src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.cpp rename to src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.cpp index 473c4932ee1ba1..18ea65cdf18e26 100644 --- a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.cpp +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.cpp @@ -16,8 +16,8 @@ */ #include -#include -#include +#include +#include using namespace chip::DeviceLayer::PersistedStorage; diff --git a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.h b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.h similarity index 92% rename from src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.h rename to src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.h index 8b3e77358c6d47..43e91793767f69 100644 --- a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.h +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include extern "C" { #include "HWParameter.h" @@ -29,7 +29,7 @@ namespace chip { namespace DeviceLayer { /** - * This class implements the FactoryDataDriver with K32W1 specific functions + * This class implements the FactoryDataDriver */ class FactoryDataDriverImpl : public FactoryDataDriver diff --git a/src/platform/nxp/common/legacy/FactoryDataProvider.cpp b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.cpp similarity index 99% rename from src/platform/nxp/common/legacy/FactoryDataProvider.cpp rename to src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.cpp index 7ecc29a54cf077..38998ed3c5bde6 100644 --- a/src/platform/nxp/common/legacy/FactoryDataProvider.cpp +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include diff --git a/src/platform/nxp/common/legacy/FactoryDataProvider.h b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.h similarity index 98% rename from src/platform/nxp/common/legacy/FactoryDataProvider.h rename to src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.h index f7d05c3f1da1f4..f84336457f0ba9 100644 --- a/src/platform/nxp/common/legacy/FactoryDataProvider.h +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.h @@ -21,7 +21,7 @@ #include #include -#include +#include #include diff --git a/src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.cpp b/src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.cpp similarity index 99% rename from src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.cpp rename to src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.cpp index c55940e8838395..abb189685bdc7f 100644 --- a/src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.cpp +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.cpp @@ -15,7 +15,7 @@ * limitations under the License. */ #include -#include +#include #include #include "fsl_adapter_flash.h" diff --git a/src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h b/src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h similarity index 98% rename from src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h rename to src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h index d7f15bba4ed422..ef23e59a6d05e6 100644 --- a/src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h +++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #if !CHIP_USE_PLAIN_DAC_KEY #include "sss_crypto.h" From 57d8cee9ad367b7728a1a660216cef1b86be0e17 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:52:48 +0300 Subject: [PATCH 06/16] [nxp][platform][k32w0] Update files after moving some components Signed-off-by: marius-alex-tache --- src/platform/nxp/k32w0/BLEManagerImpl.h | 2 +- src/platform/nxp/k32w0/BUILD.gn | 14 +++++++------- src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp | 2 +- src/platform/nxp/k32w0/OTAFactoryDataProcessor.h | 2 +- src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp | 2 +- src/platform/nxp/k32w0/OTAFirmwareProcessor.h | 2 +- src/platform/nxp/k32w0/OTAHooks.cpp | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/platform/nxp/k32w0/BLEManagerImpl.h b/src/platform/nxp/k32w0/BLEManagerImpl.h index 686eb1e3f703ee..b1aaa524af57d5 100644 --- a/src/platform/nxp/k32w0/BLEManagerImpl.h +++ b/src/platform/nxp/k32w0/BLEManagerImpl.h @@ -25,7 +25,7 @@ #include "ble_host_task_config.h" #include "controller_interface.h" -#include +#include /* host task configuration */ #define HOST_TASK_PRIORITY (4U) diff --git a/src/platform/nxp/k32w0/BUILD.gn b/src/platform/nxp/k32w0/BUILD.gn index a1b40506d6cd6a..6693acc213e4a1 100644 --- a/src/platform/nxp/k32w0/BUILD.gn +++ b/src/platform/nxp/k32w0/BUILD.gn @@ -34,8 +34,8 @@ static_library("nxp_platform") { defines = [] sources = [ "../../SingletonConfigurationManager.cpp", - "../common/legacy/BLEManagerCommon.cpp", - "../common/legacy/BLEManagerCommon.h", + "../common/ble/BLEManagerCommon.cpp", + "../common/ble/BLEManagerCommon.h", "BLEManagerImpl.cpp", "BLEManagerImpl.h", "CHIPDevicePlatformConfig.h", @@ -83,13 +83,13 @@ static_library("nxp_platform") { } if (chip_enable_ota_requestor) { - public += [ "../common/legacy/OTAImageProcessorImpl.h" ] + public += [ "../common/ota/OTAImageProcessorImpl.h" ] sources += [ - "../common/legacy/OTAImageProcessorImpl.cpp", - "../common/legacy/OTAImageProcessorImpl.h", - "../common/legacy/OTATlvProcessor.cpp", - "../common/legacy/OTATlvProcessor.h", + "../common/ota/OTAImageProcessorImpl.cpp", + "../common/ota/OTAImageProcessorImpl.h", + "../common/ota/OTATlvProcessor.cpp", + "../common/ota/OTATlvProcessor.h", ] if (chip_enable_ota_firmware_processor == 1) { diff --git a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp index b6777c7dc32820..9114906787a7b6 100644 --- a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp +++ b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp @@ -18,8 +18,8 @@ #include #include -#include #include +#include #include #include diff --git a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h index 3109e64a8d0ae3..57b973d73f0750 100644 --- a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h +++ b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp b/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp index c7a1a2bbf435dd..3fcb2fd43bf1d9 100644 --- a/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp +++ b/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include diff --git a/src/platform/nxp/k32w0/OTAFirmwareProcessor.h b/src/platform/nxp/k32w0/OTAFirmwareProcessor.h index 444243f0c885d0..933a61538e068b 100644 --- a/src/platform/nxp/k32w0/OTAFirmwareProcessor.h +++ b/src/platform/nxp/k32w0/OTAFirmwareProcessor.h @@ -19,7 +19,7 @@ #pragma once #include -#include +#include namespace chip { diff --git a/src/platform/nxp/k32w0/OTAHooks.cpp b/src/platform/nxp/k32w0/OTAHooks.cpp index 30df88177ffdc6..659422de02a362 100644 --- a/src/platform/nxp/k32w0/OTAHooks.cpp +++ b/src/platform/nxp/k32w0/OTAHooks.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include +#include #include #include From ca5eb90f175cd66b20184599219b04bd1a920e34 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:57:39 +0300 Subject: [PATCH 07/16] [nxp][mcxw71_k32w1] Update build system after moving some components Signed-off-by: marius-alex-tache --- .../contact-sensor-app/nxp/k32w1/BUILD.gn | 18 +++++-- .../contact-sensor-app/nxp/mcxw71/BUILD.gn | 21 +++++--- examples/lighting-app/nxp/k32w1/BUILD.gn | 17 ++++-- examples/lighting-app/nxp/mcxw71/BUILD.gn | 19 ++++--- .../nxp/mcxw71_k32w1/BLEManagerImpl.h | 2 +- src/platform/nxp/mcxw71_k32w1/BUILD.gn | 52 +++++++++++-------- src/platform/nxp/mcxw71_k32w1/gatt_db.h | 30 ----------- src/platform/nxp/mcxw71_k32w1/gatt_uuid128.h | 26 ---------- 8 files changed, 83 insertions(+), 102 deletions(-) delete mode 100644 src/platform/nxp/mcxw71_k32w1/gatt_db.h delete mode 100644 src/platform/nxp/mcxw71_k32w1/gatt_uuid128.h diff --git a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn index 0e24893bd06737..f054c20027795a 100644 --- a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn +++ b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn @@ -39,6 +39,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -54,6 +55,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", @@ -69,6 +73,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -104,7 +109,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { "CONFIG_NETWORK_LAYER_BLE=1", "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", "CONFIG_OPERATIONAL_KEYSTORE=1", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", ] if (chip_with_diag_logs_demo) { @@ -141,6 +146,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { "${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] @@ -149,19 +155,22 @@ mcxw71_k32w1_executable("contact_sensor_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] - include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + include_dirs += [ + "${common_example_dir}/ota_requestor/include", + "${chip_root}/src/platform/nxp/common/ota" + ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } @@ -183,7 +192,6 @@ mcxw71_k32w1_executable("contact_sensor_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { diff --git a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn index 02a0d7a78768dc..7baa60b0a872ea 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn +++ b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn @@ -38,6 +38,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -53,6 +54,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C", @@ -68,6 +72,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -103,7 +108,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { "CONFIG_NETWORK_LAYER_BLE=1", "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", "CONFIG_OPERATIONAL_KEYSTORE=1", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"" ] if (chip_with_diag_logs_demo) { @@ -140,7 +145,8 @@ mcxw71_k32w1_executable("contact_sensor_app") { "${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", - "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp" ] if (chip_with_low_power == 1) { @@ -148,19 +154,21 @@ mcxw71_k32w1_executable("contact_sensor_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", - + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] - include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + include_dirs += [ + "${common_example_dir}/ota_requestor/include", + "${chip_root}/src/platform/nxp/common/ota" + ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } @@ -182,7 +190,6 @@ mcxw71_k32w1_executable("contact_sensor_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { diff --git a/examples/lighting-app/nxp/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w1/BUILD.gn index 541c288dd1eb5c..daf4722b035ed3 100644 --- a/examples/lighting-app/nxp/k32w1/BUILD.gn +++ b/examples/lighting-app/nxp/k32w1/BUILD.gn @@ -44,6 +44,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -59,6 +60,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", @@ -74,6 +78,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -125,7 +130,7 @@ mcxw71_k32w1_executable("light_app") { "CONFIG_OPERATIONAL_KEYSTORE=1", "CONFIG_ENABLE_FEEDBACK=1", "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", ] # App common files @@ -148,18 +153,21 @@ mcxw71_k32w1_executable("light_app") { "${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] - include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + include_dirs += [ + "${common_example_dir}/ota_requestor/include", + ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } @@ -174,7 +182,6 @@ mcxw71_k32w1_executable("light_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { @@ -186,7 +193,7 @@ mcxw71_k32w1_executable("light_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } diff --git a/examples/lighting-app/nxp/mcxw71/BUILD.gn b/examples/lighting-app/nxp/mcxw71/BUILD.gn index 34733584a80cd9..79a246c18d60da 100644 --- a/examples/lighting-app/nxp/mcxw71/BUILD.gn +++ b/examples/lighting-app/nxp/mcxw71/BUILD.gn @@ -44,6 +44,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -59,6 +60,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/MCXW716C", @@ -74,6 +78,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -125,7 +130,7 @@ mcxw71_k32w1_executable("light_app") { "CONFIG_OPERATIONAL_KEYSTORE=1", "CONFIG_ENABLE_FEEDBACK=1", "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"" ] # App common files @@ -148,18 +153,21 @@ mcxw71_k32w1_executable("light_app") { "${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", - + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] - include_dirs += [ "${common_example_dir}/ota_requestor/include" ] + include_dirs += [ + "${common_example_dir}/ota_requestor/include", + "${chip_root}/src/platform/nxp/common/ota" + ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } @@ -174,7 +182,6 @@ mcxw71_k32w1_executable("light_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { @@ -186,7 +193,7 @@ mcxw71_k32w1_executable("light_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } diff --git a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h b/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h index d2b38cdeda1619..1c51cd70b4e161 100644 --- a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h +++ b/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h @@ -31,7 +31,7 @@ #include "controller_api.h" #include "controller_interface.h" -#include +#include /* host task configuration */ #define HOST_TASK_PRIORITY (4U) diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 9e190474031296..78976bfa073e94 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -32,10 +32,10 @@ assert(chip_with_low_power == 0 || source_set("nxp_factory_data") { sources = [ - "../common/legacy/FactoryDataDriver.cpp", - "../common/legacy/FactoryDataProvider.cpp", - "FactoryDataDriverImpl.cpp", - "FactoryDataProviderImpl.cpp", + "../common/factory_data/legacy/FactoryDataDriver.cpp", + "../common/factory_data/legacy/FactoryDataProvider.cpp", + "../common/factory_data/legacy/FactoryDataDriverImpl.cpp", + "../common/factory_data/legacy/FactoryDataProviderImpl.cpp", ] public = [ @@ -43,7 +43,7 @@ source_set("nxp_factory_data") { "${chip_root}/src/credentials/CertificationDeclaration.h", ] - defines = [ "PLATFORM_FACTORY_DATA_PROVIDER_IMPL_HEADER=\"platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h\"" ] + defines = [ "PLATFORM_FACTORY_DATA_PROVIDER_IMPL_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h\"" ] deps = [ ":nxp_platform", @@ -52,23 +52,23 @@ source_set("nxp_factory_data") { } source_set("nxp_ota") { - public = [ "../common/legacy/OTAImageProcessorImpl.h" ] + public = [ "../common/ota/OTAImageProcessorImpl.h" ] sources = [ - "../common/legacy/OTAImageProcessorImpl.cpp", - "../common/legacy/OTAImageProcessorImpl.h", - "../common/legacy/OTATlvProcessor.cpp", - "../common/legacy/OTATlvProcessor.h", - "OTAFirmwareProcessor.cpp", - "OTAFirmwareProcessor.h", - "OTAHooks.cpp", + "../common/ota/OTAImageProcessorImpl.cpp", + "../common/ota/OTAImageProcessorImpl.h", + "../common/ota/OTATlvProcessor.cpp", + "../common/ota/OTATlvProcessor.h", + "../common/ota/OTAFirmwareProcessor.cpp", + "../common/ota/OTAFirmwareProcessor.h", + "../common/ota/OTAHooks.cpp", ] if (chip_with_factory_data == 1 && chip_enable_ota_factory_data_processor == 1) { sources += [ - "../common/legacy/OTAFactoryDataProcessor.cpp", - "../common/legacy/OTAFactoryDataProcessor.h", + "../common/ota/OTAFactoryDataProcessor.cpp", + "../common/ota/OTAFactoryDataProcessor.h", ] } @@ -82,11 +82,19 @@ static_library("nxp_platform") { deps = [] defines = [ "CHIP_DEVICE_K32W1=1" ] + include_dirs = [ + ".", + "../common/ble", + "../common/crypto", + "../common/factory_data/legacy", + "../common/ota", + ] + sources = [ "../../SingletonConfigurationManager.cpp", - "../common/legacy/BLEManagerCommon.cpp", - "../common/legacy/BLEManagerCommon.h", - "BLEManagerImpl.cpp", + "../common/ble/BLEManagerCommon.cpp", + "../common/ble/BLEManagerCommon.h", + "../common/ble/BLEManagerImpl.cpp", "BLEManagerImpl.h", "CHIPDevicePlatformConfig.h", "CHIPDevicePlatformEvent.h", @@ -99,7 +107,6 @@ static_library("nxp_platform") { "PlatformManagerImpl.cpp", "PlatformManagerImpl.h", "SystemTimeSupport.cpp", - "ble_function_mux.c", ] if (chip_key_storage == "fwk_nvm") { @@ -153,6 +160,7 @@ static_library("nxp_platform") { "${chip_root}/src/credentials/examples/ExamplePAI.h", "${chip_root}/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h", "${chip_root}/src/platform/nxp/mcxw71_k32w1/SMU2Manager.h", + "${chip_root}/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h", ] public_deps = [ "${chip_root}/src/platform:platform_base" ] @@ -163,9 +171,9 @@ static_library("nxp_platform") { if (chip_crypto == "platform") { sources += [ - "CHIPCryptoPalK32W1.cpp", - "K32W1PersistentStorageOpKeystore.cpp", - "K32W1PersistentStorageOpKeystore.h", + "../common/crypto/CHIPCryptoPalS200.cpp", + "../common/crypto/PersistentStorageOpKeystoreS200.cpp", + "../common/crypto/PersistentStorageOpKeystoreS200.h", ] if (chip_with_ot_cli == 1) { diff --git a/src/platform/nxp/mcxw71_k32w1/gatt_db.h b/src/platform/nxp/mcxw71_k32w1/gatt_db.h deleted file mode 100644 index 604fcfb61a7ba1..00000000000000 --- a/src/platform/nxp/mcxw71_k32w1/gatt_db.h +++ /dev/null @@ -1,30 +0,0 @@ -PRIMARY_SERVICE(service_gatt, gBleSig_GenericAttributeProfile_d) -CHARACTERISTIC(char_service_changed, gBleSig_GattServiceChanged_d, (gGattCharPropRead_c | gGattCharPropNotify_c)) -VALUE(value_service_changed, gBleSig_GattServiceChanged_d, (gPermissionNone_c), 4, 0x00, 0x00, 0x00, 0x00) -CCCD(cccd_service_changed) - -PRIMARY_SERVICE(service_gap, gBleSig_GenericAccessProfile_d) -CHARACTERISTIC(char_device_name, gBleSig_GapDeviceName_d, (gGattCharPropRead_c)) -VALUE(value_device_name, gBleSig_GapDeviceName_d, (gPermissionFlagReadable_c), 16, "NXP_ELOCK_DEMO") -CHARACTERISTIC(char_appearance, gBleSig_GapAppearance_d, (gGattCharPropRead_c)) -VALUE(value_appearance, gBleSig_GapAppearance_d, (gPermissionFlagReadable_c), 2, 0x00, 0x00) - -PRIMARY_SERVICE(service_chipoble, gChipoBleService_d) -CHARACTERISTIC_UUID128(chipoble_rx, uuid_chipoble_rx, (gGattCharPropWrite_c)) -VALUE_UUID128_VARLEN(value_chipoble_rx, uuid_chipoble_rx, (gPermissionFlagWritable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) -CHARACTERISTIC_UUID128(chipoble_tx, uuid_chipoble_tx, (gGattCharPropIndicate_c | gGattCharPropRead_c)) -VALUE_UUID128_VARLEN(value_chipoble_tx, uuid_chipoble_tx, (gPermissionFlagReadable_c), gAttMaxMtu_c - 3, gAttMaxMtu_c - 3, 0x00) -CCCD(cccd_chipoble_tx) -CHARACTERISTIC_UUID128(chipoble_c3, uuid_chipoble_c3, (gGattCharPropRead_c)) -VALUE_UUID128_VARLEN(value_chipoble_c3, uuid_chipoble_c3, (gPermissionFlagReadable_c), gAttMaxReadDataSize_d(gAttMaxValueLength_c), - gAttMaxReadDataSize_d(gAttMaxValueLength_c), 0x00) - -PRIMARY_SERVICE(service_device_info, gBleSig_DeviceInformationService_d) -CHARACTERISTIC(char_model_no, gBleSig_ModelNumberString_d, (gGattCharPropRead_c)) -VALUE(value_model_no, gBleSig_ModelNumberString_d, (gPermissionFlagReadable_c), 15, "Chip ELock Demo") -CHARACTERISTIC(char_serial_no, gBleSig_SerialNumberString_d, (gGattCharPropRead_c)) -VALUE(value_serial_no, gBleSig_SerialNumberString_d, (gPermissionFlagReadable_c), 7, "BLESN01") -CHARACTERISTIC(char_fw_rev, gBleSig_FirmwareRevisionString_d, (gGattCharPropRead_c)) -VALUE(value_fw_rev, gBleSig_FirmwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.1") -CHARACTERISTIC(char_sw_rev, gBleSig_SoftwareRevisionString_d, (gGattCharPropRead_c)) -VALUE(value_sw_rev, gBleSig_SoftwareRevisionString_d, (gPermissionFlagReadable_c), 5, "1.1.4") diff --git a/src/platform/nxp/mcxw71_k32w1/gatt_uuid128.h b/src/platform/nxp/mcxw71_k32w1/gatt_uuid128.h deleted file mode 100644 index 938968b1943ce2..00000000000000 --- a/src/platform/nxp/mcxw71_k32w1/gatt_uuid128.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -* Declare all custom 128-bit UUIDs here using the format: -* -* UUID128(name, bytes) -* -* where: -* -name : an unique tag for the newly defined UUID; - will be used to reference this UUID when defining - services and characteristics in <> -* -bytes: 16 bytes representing the 128-bit value -* -* One definition per line. No semicolon required after each definition. -* -* example: -* UUID128(uuid_service_robot_characteristics, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, -0xCD, 0xEF) -* UUID128(uuid_char_robot_direction, 0x12, 0x34, 0x50, 0x00, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, -0xEF) -*/ -/* Services */ - -#define gChipoBleService_d 0xFFF6 - -UUID128(uuid_chipoble_tx, 0x12, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) -UUID128(uuid_chipoble_rx, 0x11, 0x9D, 0x9F, 0x42, 0x9C, 0x4F, 0x9F, 0x95, 0x59, 0x45, 0x3D, 0x26, 0xF5, 0x2E, 0xEE, 0x18) -UUID128(uuid_chipoble_c3, 0x04, 0x8f, 0x21, 0x83, 0x8a, 0x74, 0x7d, 0xb8, 0xf2, 0x45, 0x72, 0x87, 0x38, 0x02, 0x63, 0x64) From 06fe1b30ba2fb9eab064e56d44375994e3670480 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:59:03 +0300 Subject: [PATCH 08/16] [nxp][examples][k32w0] Update build system after moving some components Signed-off-by: marius-alex-tache --- examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp | 2 +- examples/lighting-app/nxp/k32w0/main/AppTask.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp index d350a4527d281c..36cf190adf0b54 100644 --- a/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp +++ b/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #endif #include diff --git a/examples/lighting-app/nxp/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp index 7db25b0a7c0451..2418ab85978eb2 100644 --- a/examples/lighting-app/nxp/k32w0/main/AppTask.cpp +++ b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #endif #include "DefaultTestEventTriggerDelegate.h" From b5827d72241142613a1f45b5bb5ce3514ee90109 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 13:01:40 +0300 Subject: [PATCH 09/16] [nxp][scripts][common] Update list of supported devices for multi-image OTA Signed-off-by: marius-alex-tache --- scripts/tools/nxp/ota/README.md | 48 +++++++++++++++------------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/scripts/tools/nxp/ota/README.md b/scripts/tools/nxp/ota/README.md index 5c3a12adba7cf9..d7302e0e579023 100644 --- a/scripts/tools/nxp/ota/README.md +++ b/scripts/tools/nxp/ota/README.md @@ -11,10 +11,14 @@ format. The payload contains data in standard TLV format (not Matter TLV format). During OTA transfer, these TLV can span across multiple BDX blocks, thus the `OTAImageProcessorImpl` instance should take this into account. +For details related to the OTA implementation, please see +[OTA README](../../../../src/platform/nxp/common/ota/README.md). + ## Supported platforms -- K32W0 - - [K32W OTA README](../../../../src/platform/nxp/common/legacy/OTA_README.md) +- k32w0 +- k32w1 +- mcxw71 ## Usage @@ -31,30 +35,22 @@ reference commands. The list of **custom options**: -``` -# Application options ---app-input-file --> Path to the application binary. ---app-version --> Application version. It's part of the descriptor and - can be different than the OTA image header version: -vn. ---app-version-str --> Application version string. Same as above. ---app-build-date --> Application build date. Same as above. - -# SSBL options ---bl-input-file --> Path to the SSBL binary. ---bl-version --> SSBL version. ---bl-version-str --> SSBL version string. ---bl-build-date --> SSBL build date. - -# Factory data options ---factory-data --> If set, enables the generation of factory data. ---cert_declaration --> Certification Declaration. ---dac_cert --> DAC certificate. ---dac_key --> DAC private key. ---pai_cert --> PAI certificate. - -# Custom TLV options ---json --> Path to a JSON file following ota_payload.schema -``` +| option | description | +| -------------------- | -------------------------------------------------- | +| `--app-input-file` | Path to the application binary | +| `--app-version` | Application version. Can differ from `-vn` | +| `--app-version-str` | Application version string. Same as above | +| `--app-build-date` | Application build date. Same as above | +| `--bl-input-file` | Path to the SSBL binary | +| `--bl-version` | SSBL version | +| `--bl-version-str` | SSBL version string | +| `--bl-build-date` | SSBL build date | +| `--factory-data` | Enable the generation of factory data | +| `--cert_declaration` | Matter Certification Declaration | +| `--dac_cert` | Matter DAC certificate | +| `--dac_key` | Matter DAC private key | +| `--pai_cert` | Matter PAI certificate | +| `--json` | Path to a JSON file following `ota_payload.schema` | Please note that the options above are separated into four categories: application, bootloader, factory data and custom TLV (`--json` option). If no From acfec04c9a46c859395ad4b8a85f1854d964c864 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Thu, 12 Sep 2024 17:28:16 +0300 Subject: [PATCH 10/16] [nxp] Bump nxp_matter_support Signed-off-by: marius-alex-tache --- third_party/nxp/nxp_matter_support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/nxp/nxp_matter_support b/third_party/nxp/nxp_matter_support index f6329bb2280c8b..21d18627ad4671 160000 --- a/third_party/nxp/nxp_matter_support +++ b/third_party/nxp/nxp_matter_support @@ -1 +1 @@ -Subproject commit f6329bb2280c8bc3f50f6d39e79191499e67cffa +Subproject commit 21d18627ad46710dfb863080c1047cdbaf556d25 From f83f0d5301dfc1e4a7f3998203bb9bad8c449347 Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Wed, 11 Sep 2024 12:58:29 +0300 Subject: [PATCH 11/16] [nxp][mcxw71_k32w1][lock-app] Update build system after moving some components Signed-off-by: marius-alex-tache --- examples/lock-app/nxp/k32w1/BUILD.gn | 14 +++++++++----- examples/lock-app/nxp/mcxw71/BUILD.gn | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/examples/lock-app/nxp/k32w1/BUILD.gn b/examples/lock-app/nxp/k32w1/BUILD.gn index b8b6b7f67fa34c..cfbe23284c3e74 100644 --- a/examples/lock-app/nxp/k32w1/BUILD.gn +++ b/examples/lock-app/nxp/k32w1/BUILD.gn @@ -37,6 +37,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -52,6 +53,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", @@ -67,6 +71,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -102,7 +107,7 @@ mcxw71_k32w1_executable("lock_app") { "CONFIG_NETWORK_LAYER_BLE=1", "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", "CONFIG_OPERATIONAL_KEYSTORE=1", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", "CONFIG_APP_FREERTOS_OS=1", ] @@ -143,6 +148,7 @@ mcxw71_k32w1_executable("lock_app") { #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${common_example_dir}/icd/source/ICDUtil.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] @@ -152,7 +158,7 @@ mcxw71_k32w1_executable("lock_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } @@ -170,8 +176,7 @@ mcxw71_k32w1_executable("lock_app") { if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", - + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] @@ -198,7 +203,6 @@ mcxw71_k32w1_executable("lock_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { diff --git a/examples/lock-app/nxp/mcxw71/BUILD.gn b/examples/lock-app/nxp/mcxw71/BUILD.gn index effa43f226640b..23a8a693e082ac 100644 --- a/examples/lock-app/nxp/mcxw71/BUILD.gn +++ b/examples/lock-app/nxp/mcxw71/BUILD.gn @@ -37,6 +37,7 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" +support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -52,6 +53,9 @@ mcxw71_k32w1_sdk("sdk") { # Indicate the default path to OpenThreadConfig.h include_dirs += [ "${example_platform_dir}/app/project_include/openthread" ] + # Indicate the default path to GATT database + include_dirs += [ "${support_common_platform_dir}/ble" ] + include_dirs += [ "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/K32W1480", @@ -67,6 +71,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", + "${support_common_platform_dir}/ble/ble_function_mux.c" ] if (is_debug) { @@ -102,7 +107,7 @@ mcxw71_k32w1_executable("lock_app") { "CONFIG_NETWORK_LAYER_BLE=1", "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", "CONFIG_OPERATIONAL_KEYSTORE=1", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/legacy/FactoryDataProvider.h\"", + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", "CONFIG_APP_FREERTOS_OS=1", ] @@ -143,6 +148,7 @@ mcxw71_k32w1_executable("lock_app") { #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${common_example_dir}/icd/source/ICDUtil.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] @@ -152,7 +158,7 @@ mcxw71_k32w1_executable("lock_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/legacy" ] + include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } @@ -170,8 +176,7 @@ mcxw71_k32w1_executable("lock_app") { if (chip_enable_ota_requestor) { defines += [ - "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/legacy/OTAImageProcessorImpl.h\"", - + "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] @@ -198,7 +203,6 @@ mcxw71_k32w1_executable("lock_app") { sources += [ "${example_platform_dir}/button/ButtonManager.cpp", "${example_platform_dir}/clusters/Identify.cpp", - "${example_platform_dir}/operational_keystore/OperationalKeystore.cpp", ] if (chip_enable_ota_requestor) { From c9e7034162d8cd20ca9a2bdf032c4586dafbe903 Mon Sep 17 00:00:00 2001 From: Doru Gucea Date: Fri, 13 Sep 2024 16:26:26 +0300 Subject: [PATCH 12/16] [nxp][mcxw71_k32w1] Fix factory data compilation issue Signed-off-by: Doru Gucea --- src/platform/nxp/mcxw71_k32w1/BUILD.gn | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 78976bfa073e94..01a84f771e177f 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -78,10 +78,7 @@ source_set("nxp_ota") { ] } -static_library("nxp_platform") { - deps = [] - defines = [ "CHIP_DEVICE_K32W1=1" ] - +config("nxp_platform_config") { include_dirs = [ ".", "../common/ble", @@ -89,6 +86,11 @@ static_library("nxp_platform") { "../common/factory_data/legacy", "../common/ota", ] +} + +static_library("nxp_platform") { + deps = [] + defines = [ "CHIP_DEVICE_K32W1=1" ] sources = [ "../../SingletonConfigurationManager.cpp", @@ -216,4 +218,6 @@ static_library("nxp_platform") { "${chip_root}/src/platform:syscalls_stub", "${chip_root}/src/platform/logging:headers", ] + + public_configs = [ ":nxp_platform_config" ] } From cf9bed9f9b8de4a28c7548a79fd32ac0f437bee9 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 16 Sep 2024 06:31:49 +0000 Subject: [PATCH 13/16] Restyled by gn --- examples/contact-sensor-app/nxp/k32w1/BUILD.gn | 10 ++++++---- examples/contact-sensor-app/nxp/mcxw71/BUILD.gn | 15 +++++++++------ examples/lighting-app/nxp/k32w1/BUILD.gn | 12 ++++++------ examples/lighting-app/nxp/mcxw71/BUILD.gn | 13 ++++++++----- examples/lock-app/nxp/k32w1/BUILD.gn | 11 +++++++---- examples/lock-app/nxp/mcxw71/BUILD.gn | 11 +++++++---- src/platform/nxp/mcxw71_k32w1/BUILD.gn | 8 ++++---- 7 files changed, 47 insertions(+), 33 deletions(-) diff --git a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn index f054c20027795a..e887b2c5cc4f7f 100644 --- a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn +++ b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn @@ -39,7 +39,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -73,7 +74,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -155,7 +156,8 @@ mcxw71_k32w1_executable("contact_sensor_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } @@ -169,7 +171,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { include_dirs += [ "${common_example_dir}/ota_requestor/include", - "${chip_root}/src/platform/nxp/common/ota" + "${chip_root}/src/platform/nxp/common/ota", ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] diff --git a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn index 7baa60b0a872ea..87b25125d1c47c 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn +++ b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn @@ -38,7 +38,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -72,7 +73,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -108,7 +109,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { "CONFIG_NETWORK_LAYER_BLE=1", "CONFIG_THREAD_DEVICE_TYPE=kThreadDeviceType_SleepyEndDevice", "CONFIG_OPERATIONAL_KEYSTORE=1", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"" + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", ] if (chip_with_diag_logs_demo) { @@ -146,7 +147,7 @@ mcxw71_k32w1_executable("contact_sensor_app") { "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", - "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp" + "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] if (chip_with_low_power == 1) { @@ -154,20 +155,22 @@ mcxw71_k32w1_executable("contact_sensor_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } if (chip_enable_ota_requestor) { defines += [ "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] include_dirs += [ "${common_example_dir}/ota_requestor/include", - "${chip_root}/src/platform/nxp/common/ota" + "${chip_root}/src/platform/nxp/common/ota", ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] diff --git a/examples/lighting-app/nxp/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w1/BUILD.gn index daf4722b035ed3..8b5bd6b2cd77f2 100644 --- a/examples/lighting-app/nxp/k32w1/BUILD.gn +++ b/examples/lighting-app/nxp/k32w1/BUILD.gn @@ -44,7 +44,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -78,7 +79,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -165,9 +166,7 @@ mcxw71_k32w1_executable("light_app") { "LED_MANAGER_ENABLE_STATUS_LED=0", ] - include_dirs += [ - "${common_example_dir}/ota_requestor/include", - ] + include_dirs += [ "${common_example_dir}/ota_requestor/include" ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } @@ -193,7 +192,8 @@ mcxw71_k32w1_executable("light_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } diff --git a/examples/lighting-app/nxp/mcxw71/BUILD.gn b/examples/lighting-app/nxp/mcxw71/BUILD.gn index 79a246c18d60da..b5d393dc6b9afc 100644 --- a/examples/lighting-app/nxp/mcxw71/BUILD.gn +++ b/examples/lighting-app/nxp/mcxw71/BUILD.gn @@ -44,7 +44,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -78,7 +79,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -130,7 +131,7 @@ mcxw71_k32w1_executable("light_app") { "CONFIG_OPERATIONAL_KEYSTORE=1", "CONFIG_ENABLE_FEEDBACK=1", "APP_QUEUE_TICKS_TO_WAIT=pdMS_TO_TICKS(10)", - "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"" + "EXTERNAL_FACTORY_DATA_PROVIDER_HEADER=\"platform/nxp/common/factory_data/legacy/FactoryDataProvider.h\"", ] # App common files @@ -160,13 +161,14 @@ mcxw71_k32w1_executable("light_app") { if (chip_enable_ota_requestor) { defines += [ "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] include_dirs += [ "${common_example_dir}/ota_requestor/include", - "${chip_root}/src/platform/nxp/common/ota" + "${chip_root}/src/platform/nxp/common/ota", ] sources += [ "${common_example_dir}/ota_requestor/source/OTARequestorInitiatorMultiImage.cpp" ] deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] @@ -193,7 +195,8 @@ mcxw71_k32w1_executable("light_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } diff --git a/examples/lock-app/nxp/k32w1/BUILD.gn b/examples/lock-app/nxp/k32w1/BUILD.gn index cfbe23284c3e74..42cff8a8b42c45 100644 --- a/examples/lock-app/nxp/k32w1/BUILD.gn +++ b/examples/lock-app/nxp/k32w1/BUILD.gn @@ -37,7 +37,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -71,7 +72,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -148,8 +149,8 @@ mcxw71_k32w1_executable("lock_app") { #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", - "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${common_example_dir}/icd/source/ICDUtil.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] @@ -158,7 +159,8 @@ mcxw71_k32w1_executable("lock_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } @@ -177,6 +179,7 @@ mcxw71_k32w1_executable("lock_app") { if (chip_enable_ota_requestor) { defines += [ "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] diff --git a/examples/lock-app/nxp/mcxw71/BUILD.gn b/examples/lock-app/nxp/mcxw71/BUILD.gn index 23a8a693e082ac..febab870a524ca 100644 --- a/examples/lock-app/nxp/mcxw71/BUILD.gn +++ b/examples/lock-app/nxp/mcxw71/BUILD.gn @@ -37,7 +37,8 @@ assert(target_os == "freertos") example_platform_dir = "${chip_root}/examples/platform/nxp/${nxp_platform}" common_example_dir = "${chip_root}/examples/platform/nxp/common" -support_common_platform_dir = "${nxp_sdk_matter_support_root}/examples/platform/common" +support_common_platform_dir = + "${nxp_sdk_matter_support_root}/examples/platform/common" mcxw71_k32w1_sdk("sdk") { defines = [] @@ -71,7 +72,7 @@ mcxw71_k32w1_sdk("sdk") { "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_extflash.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/board_lp.c", "${nxp_sdk_root}/middleware/wireless/framework/boards/kw45_k32w1/hardware_init.c", - "${support_common_platform_dir}/ble/ble_function_mux.c" + "${support_common_platform_dir}/ble/ble_function_mux.c", ] if (is_debug) { @@ -148,8 +149,8 @@ mcxw71_k32w1_executable("lock_app") { #"${common_example_dir}/clusters/source/ZclCallbacks.cpp", "${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp", "${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp", - "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${common_example_dir}/icd/source/ICDUtil.cpp", + "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp", "${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp", ] @@ -158,7 +159,8 @@ mcxw71_k32w1_executable("lock_app") { } if (chip_with_factory_data == 1) { - include_dirs += [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] + include_dirs += + [ "${chip_root}/src/platform/nxp/common/factory_data/legacy" ] deps += [ "${chip_root}/src/platform/nxp:nxp_factory_data" ] } @@ -177,6 +179,7 @@ mcxw71_k32w1_executable("lock_app") { if (chip_enable_ota_requestor) { defines += [ "CONFIG_CHIP_OTA_IMAGE_PROCESSOR_HEADER=\"platform/nxp/common/ota/OTAImageProcessorImpl.h\"", + # The status LED and the external flash CS pin are wired together. The OTA image writing may fail if used together. "LED_MANAGER_ENABLE_STATUS_LED=0", ] diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 01a84f771e177f..4a4cd533e19415 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -33,8 +33,8 @@ assert(chip_with_low_power == 0 || source_set("nxp_factory_data") { sources = [ "../common/factory_data/legacy/FactoryDataDriver.cpp", - "../common/factory_data/legacy/FactoryDataProvider.cpp", "../common/factory_data/legacy/FactoryDataDriverImpl.cpp", + "../common/factory_data/legacy/FactoryDataProvider.cpp", "../common/factory_data/legacy/FactoryDataProviderImpl.cpp", ] @@ -55,13 +55,13 @@ source_set("nxp_ota") { public = [ "../common/ota/OTAImageProcessorImpl.h" ] sources = [ + "../common/ota/OTAFirmwareProcessor.cpp", + "../common/ota/OTAFirmwareProcessor.h", + "../common/ota/OTAHooks.cpp", "../common/ota/OTAImageProcessorImpl.cpp", "../common/ota/OTAImageProcessorImpl.h", "../common/ota/OTATlvProcessor.cpp", "../common/ota/OTATlvProcessor.h", - "../common/ota/OTAFirmwareProcessor.cpp", - "../common/ota/OTAFirmwareProcessor.h", - "../common/ota/OTAHooks.cpp", ] if (chip_with_factory_data == 1 && From b215269b828c4bc341ff2b493b9b0084d1b7a8ee Mon Sep 17 00:00:00 2001 From: marius-alex-tache Date: Mon, 16 Sep 2024 09:35:32 +0300 Subject: [PATCH 14/16] [nxp][ota] Fix spelling of platforms Signed-off-by: marius-alex-tache --- scripts/tools/nxp/ota/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/tools/nxp/ota/README.md b/scripts/tools/nxp/ota/README.md index d7302e0e579023..d2f8fd17a5d028 100644 --- a/scripts/tools/nxp/ota/README.md +++ b/scripts/tools/nxp/ota/README.md @@ -16,9 +16,9 @@ For details related to the OTA implementation, please see ## Supported platforms -- k32w0 -- k32w1 -- mcxw71 +- `k32w0` +- `k32w1` +- `mcxw71` ## Usage From cd4d1064322c82d845a3bbd4e8fc4ce3412fc0be Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 16 Sep 2024 06:48:25 +0000 Subject: [PATCH 15/16] Restyled by gn --- src/platform/nxp/mcxw71_k32w1/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/nxp/mcxw71_k32w1/BUILD.gn b/src/platform/nxp/mcxw71_k32w1/BUILD.gn index 4a4cd533e19415..253e21e4ef6a97 100644 --- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn +++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn @@ -160,9 +160,9 @@ static_library("nxp_platform") { "${chip_root}/src/credentials/examples/DeviceAttestationCredsExample.h", "${chip_root}/src/credentials/examples/ExampleDACs.h", "${chip_root}/src/credentials/examples/ExamplePAI.h", + "${chip_root}/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h", "${chip_root}/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h", "${chip_root}/src/platform/nxp/mcxw71_k32w1/SMU2Manager.h", - "${chip_root}/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h", ] public_deps = [ "${chip_root}/src/platform:platform_base" ] From 96a88c2babfc8077f35c1d865eed6bb1ceb5a3b2 Mon Sep 17 00:00:00 2001 From: Marius Tache Date: Wed, 7 Aug 2024 17:21:48 +0300 Subject: [PATCH 16/16] [nxp][platform][k32w0] Move setting of k32w0_sdk_root k32w0_sdk_root set was moved to nxp_matter_support submodule Signed-off-by: Marius Tache --- src/platform/nxp/k32w0/args.gni | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/platform/nxp/k32w0/args.gni b/src/platform/nxp/k32w0/args.gni index 1076eea4f4cf7f..fda52672cf50e0 100644 --- a/src/platform/nxp/k32w0/args.gni +++ b/src/platform/nxp/k32w0/args.gni @@ -22,12 +22,6 @@ nxp_device_layer = "nxp/${nxp_platform}" nxp_use_lwip = false nxp_use_mbedtls_port = false -if (getenv("NXP_K32W0_SDK_ROOT") == "") { - k32w0_sdk_root = "${nxp_sdk_matter_support_root}/github_sdk/k32w0/repo" -} else { - k32w0_sdk_root = getenv("NXP_K32W0_SDK_ROOT") -} - # ARM architecture flags will be set based on NXP board. arm_platform_config = "${nxp_sdk_build_root}/${nxp_sdk_name}/nxp_arm.gni"