[NXP] Move some components in common (#35594)
* [nxp][platform][common] Rename S200 crypto PAL and move it to common
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][examples][common] Make S200 Operational Keystore common
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [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 <marius.tache@nxp.com>
* [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 <marius.tache@nxp.com>
* [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 <marius.tache@nxp.com>
* [nxp][platform][k32w0] Update files after moving some components
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][mcxw71_k32w1] Update build system after moving some components
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][examples][k32w0] Update build system after moving some components
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][scripts][common] Update list of supported devices for multi-image OTA
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp] Bump nxp_matter_support
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][mcxw71_k32w1][lock-app] Update build system after moving some components
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* [nxp][mcxw71_k32w1] Fix factory data compilation issue
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
* Restyled by gn
* [nxp][ota] Fix spelling of platforms
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
* Restyled by gn
* [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 <marius.tache@nxp.com>
---------
Signed-off-by: marius-alex-tache <marius.tache@nxp.com>
Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Signed-off-by: Marius Tache <marius.tache@nxp.com>
Co-authored-by: Doru Gucea <doru-cristian.gucea@nxp.com>
Co-authored-by: Restyled.io <commits@restyled.io>
diff --git a/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w0/main/AppTask.cpp
index d350a45..36cf190 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 <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorDriver.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
-#include <src/platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <src/platform/nxp/common/ota/OTAImageProcessorImpl.h>
#endif
#include <src/platform/nxp/k32w0/BLEManagerImpl.h>
diff --git a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn
index 0e24893..e887b2c 100644
--- a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn
+++ b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn
@@ -39,6 +39,8 @@
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 +56,9 @@
# 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 +74,7 @@
"${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 +110,7 @@
"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 +147,7 @@
"${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 +156,23 @@
}
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 +194,6 @@
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 02a0d7a..87b2512 100644
--- a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn
+++ b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn
@@ -38,6 +38,8 @@
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 +55,9 @@
# 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 +73,7 @@
"${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 +109,7 @@
"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,6 +146,7 @@
"${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",
]
@@ -148,19 +155,23 @@
}
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 +193,6 @@
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/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp
index 7db25b0..2418ab8 100644
--- a/examples/lighting-app/nxp/k32w0/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w0/main/AppTask.cpp
@@ -43,7 +43,7 @@
#include <app/clusters/ota-requestor/DefaultOTARequestor.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorDriver.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
-#include <src/platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <src/platform/nxp/common/ota/OTAImageProcessorImpl.h>
#endif
#include "DefaultTestEventTriggerDelegate.h"
diff --git a/examples/lighting-app/nxp/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w1/BUILD.gn
index 541c288..8b5bd6b 100644
--- a/examples/lighting-app/nxp/k32w1/BUILD.gn
+++ b/examples/lighting-app/nxp/k32w1/BUILD.gn
@@ -44,6 +44,8 @@
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 +61,9 @@
# 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 +79,7 @@
"${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 +131,7 @@
"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,12 +154,13 @@
"${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",
@@ -174,7 +181,6 @@
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 +192,8 @@
}
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 3473358..b5d393d 100644
--- a/examples/lighting-app/nxp/mcxw71/BUILD.gn
+++ b/examples/lighting-app/nxp/mcxw71/BUILD.gn
@@ -44,6 +44,8 @@
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 +61,9 @@
# 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 +79,7 @@
"${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 +131,7 @@
"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 +154,22 @@
"${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 +184,6 @@
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 +195,8 @@
}
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/lock-app/nxp/k32w1/BUILD.gn b/examples/lock-app/nxp/k32w1/BUILD.gn
index b8b6b7f..42cff8a 100644
--- a/examples/lock-app/nxp/k32w1/BUILD.gn
+++ b/examples/lock-app/nxp/k32w1/BUILD.gn
@@ -37,6 +37,8 @@
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 +54,9 @@
# 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 +72,7 @@
"${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 +108,7 @@
"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",
]
@@ -144,6 +150,7 @@
"${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp",
"${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp",
"${common_example_dir}/icd/source/ICDUtil.cpp",
+ "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp",
"${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp",
]
@@ -152,7 +159,8 @@
}
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,7 +178,7 @@
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 +206,6 @@
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 effa43f..febab87 100644
--- a/examples/lock-app/nxp/mcxw71/BUILD.gn
+++ b/examples/lock-app/nxp/mcxw71/BUILD.gn
@@ -37,6 +37,8 @@
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 +54,9 @@
# 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 +72,7 @@
"${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 +108,7 @@
"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",
]
@@ -144,6 +150,7 @@
"${common_example_dir}/device_callbacks/source/CommonDeviceCallbacks.cpp",
"${common_example_dir}/device_manager/source/CHIPDeviceManager.cpp",
"${common_example_dir}/icd/source/ICDUtil.cpp",
+ "${common_example_dir}/operational_keystore/source/OperationalKeystoreS200.cpp",
"${example_platform_dir}/factory_data/source/AppFactoryDataExample.cpp",
]
@@ -152,7 +159,8 @@
}
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,7 +178,7 @@
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 +206,6 @@
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/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 ecd7226..04f89e4 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 <platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h>
-static chip::K32W1PersistentStorageOpKeystore sInstance;
+static chip::PersistentStorageOpKeystoreS200 sInstance;
chip::Crypto::OperationalKeystore * chip::NXP::App::OperationalKeystore::GetInstance()
{
diff --git a/scripts/tools/nxp/ota/README.md b/scripts/tools/nxp/ota/README.md
index 5c3a12a..d2f8fd1 100644
--- a/scripts/tools/nxp/ota/README.md
+++ b/scripts/tools/nxp/ota/README.md
@@ -11,10 +11,14 @@
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 @@
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
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 d9dbde8..02871e3 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 b7fc127..780ee19 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 1eefdf5..e8ac5e9 100644
--- a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.cpp
+++ b/src/platform/nxp/common/ble/BLEManagerImpl.cpp
@@ -28,7 +28,12 @@
/*! Event for the Host Task Queue */
OSA_EVENT_HANDLE_DEFINE(gHost_TaskEvent);
-#include <platform/nxp/mcxw71_k32w1/BLEManagerImpl.h>
+#ifdef EXTERNAL_BLEMANAGERIMPL_HEADER
+#include EXTERNAL_BLEMANAGERIMPL_HEADER
+#elif defined(CHIP_DEVICE_LAYER_TARGET)
+#define BLEMANAGERIMPL_HEADER <platform/CHIP_DEVICE_LAYER_TARGET/BLEManagerImpl.h>
+#include BLEMANAGERIMPL_HEADER
+#endif // defined(CHIP_DEVICE_LAYER_TARGET)
extern "C" bleResult_t Hci_Reset(void);
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 9506d1b..6e93426 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 <crypto/CHIPCryptoPAL.h>
diff --git a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp
similarity index 88%
rename from src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp
rename to src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp
index a3a4a48..09744d2 100644
--- a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.cpp
+++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.cpp
@@ -29,7 +29,7 @@
#include <lib/core/CHIPSafeCasts.h>
#include <lib/support/SafePointerCast.h>
-#include "K32W1PersistentStorageOpKeystore.h"
+#include "PersistentStorageOpKeystoreS200.h"
#include "sss_crypto.h"
@@ -82,7 +82,7 @@
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,8 +102,8 @@
return (err == CHIP_NO_ERROR && (keySize == SSS_KEY_PAIR_BLOB_SIZE));
}
-CHIP_ERROR K32W1PersistentStorageOpKeystore::NewOpKeypairForFabric(FabricIndex fabricIndex,
- MutableByteSpan & outCertificateSigningRequest)
+CHIP_ERROR PersistentStorageOpKeystoreS200::NewOpKeypairForFabric(FabricIndex fabricIndex,
+ MutableByteSpan & outCertificateSigningRequest)
{
VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE);
VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX);
@@ -135,8 +135,8 @@
return CHIP_NO_ERROR;
}
-CHIP_ERROR K32W1PersistentStorageOpKeystore::ActivateOpKeypairForFabric(FabricIndex fabricIndex,
- const Crypto::P256PublicKey & nocPublicKey)
+CHIP_ERROR PersistentStorageOpKeystoreS200::ActivateOpKeypairForFabric(FabricIndex fabricIndex,
+ const Crypto::P256PublicKey & nocPublicKey)
{
VerifyOrReturnError(mStorage != nullptr, CHIP_ERROR_INCORRECT_STATE);
VerifyOrReturnError(mPendingKeypair != nullptr, CHIP_ERROR_INVALID_FABRIC_INDEX);
@@ -149,7 +149,7 @@
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 @@
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 @@
return err;
}
-void K32W1PersistentStorageOpKeystore::RevertPendingKeypair()
+void PersistentStorageOpKeystoreS200::RevertPendingKeypair()
{
VerifyOrReturn(mStorage != nullptr);
@@ -196,8 +196,8 @@
ResetPendingKey();
}
-CHIP_ERROR K32W1PersistentStorageOpKeystore::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message,
- Crypto::P256ECDSASignature & outSignature) const
+CHIP_ERROR PersistentStorageOpKeystoreS200::SignWithOpKeypair(FabricIndex fabricIndex, const ByteSpan & message,
+ Crypto::P256ECDSASignature & outSignature) const
{
CHIP_ERROR error = CHIP_NO_ERROR;
@@ -239,7 +239,7 @@
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 @@
return Platform::New<Crypto::P256Keypair>();
}
-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 92%
rename from src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h
rename to src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h
index c0aeabc..12edb9d 100644
--- a/src/platform/nxp/mcxw71_k32w1/K32W1PersistentStorageOpKeystore.h
+++ b/src/platform/nxp/common/crypto/PersistentStorageOpKeystoreS200.h
@@ -61,15 +61,15 @@
* 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.
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 6ddbedc..f54406c 100644
--- a/src/platform/nxp/common/legacy/FactoryDataDriver.cpp
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriver.cpp
@@ -17,8 +17,8 @@
#include <lib/support/CodeUtils.h>
#include <lib/support/Span.h>
-#include <platform/nxp/common/legacy/FactoryDataDriver.h>
-#include <platform/nxp/common/legacy/FactoryDataProvider.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataDriver.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProvider.h>
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 473c493..18ea65c 100644
--- a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.cpp
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.cpp
@@ -16,8 +16,8 @@
*/
#include <platform/KeyValueStoreManager.h>
-#include <platform/nxp/common/legacy/FactoryDataProvider.h>
-#include <platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProvider.h>
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 8b3e773..43e9179 100644
--- a/src/platform/nxp/mcxw71_k32w1/FactoryDataDriverImpl.h
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataDriverImpl.h
@@ -19,7 +19,7 @@
#include <crypto/CHIPCryptoPAL.h>
#include <lib/core/CHIPPersistentStorageDelegate.h>
#include <lib/support/DefaultStorageKeyAllocator.h>
-#include <platform/nxp/common/legacy/FactoryDataDriver.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataDriver.h>
extern "C" {
#include "HWParameter.h"
@@ -29,7 +29,7 @@
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 7ecc29a..38998ed 100644
--- a/src/platform/nxp/common/legacy/FactoryDataProvider.cpp
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.cpp
@@ -29,7 +29,7 @@
#include <lib/support/Base64.h>
#include <lib/support/Span.h>
#include <platform/ConfigurationManager.h>
-#include <platform/nxp/common/legacy/FactoryDataProvider.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProvider.h>
#include <cctype>
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 f7d05c3..f843364 100644
--- a/src/platform/nxp/common/legacy/FactoryDataProvider.h
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProvider.h
@@ -21,7 +21,7 @@
#include <platform/internal/GenericDeviceInstanceInfoProvider.h>
#include <src/lib/core/CHIPError.h>
-#include <platform/nxp/common/legacy/FactoryDataDriver.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataDriver.h>
#include <vector>
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 c55940e..abb1896 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 <platform/KeyValueStoreManager.h>
-#include <platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h>
#include <src/app/clusters/ota-requestor/OTARequestorInterface.h>
#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 97%
rename from src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h
rename to src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h
index d7f15bb..ef23e59 100644
--- a/src/platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h
+++ b/src/platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h
@@ -19,7 +19,7 @@
#include <crypto/CHIPCryptoPAL.h>
#include <lib/core/CHIPPersistentStorageDelegate.h>
#include <lib/support/DefaultStorageKeyAllocator.h>
-#include <platform/nxp/common/legacy/FactoryDataProvider.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProvider.h>
#if !CHIP_USE_PLAIN_DAC_KEY
#include "sss_crypto.h"
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 604fcfb..0000000
--- 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 938968b..0000000
--- 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 <<gattDb.h>>
-* -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/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 4960ca2..421f020 100644
--- a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.cpp
+++ b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.cpp
@@ -19,7 +19,7 @@
#include <app/server/Server.h>
#include <lib/core/TLV.h>
#include <platform/internal/CHIPDeviceLayerInternal.h>
-#include <platform/nxp/common/legacy/OTAFactoryDataProcessor.h>
+#include <platform/nxp/common/ota/OTAFactoryDataProcessor.h>
namespace chip {
diff --git a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.h
similarity index 91%
rename from src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h
rename to src/platform/nxp/common/ota/OTAFactoryDataProcessor.h
index 862aad2..570a33c 100644
--- a/src/platform/nxp/common/legacy/OTAFactoryDataProcessor.h
+++ b/src/platform/nxp/common/ota/OTAFactoryDataProcessor.h
@@ -21,9 +21,9 @@
#include <lib/core/Optional.h>
#include <lib/support/ScopedBuffer.h>
#include <lib/support/Span.h>
-#include <platform/nxp/common/legacy/FactoryDataDriver.h>
-#include <platform/nxp/common/legacy/FactoryDataProvider.h>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataDriver.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProvider.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
#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 2ea4d47..15aa5f2 100644
--- a/src/platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.cpp
+++ b/src/platform/nxp/common/ota/OTAFirmwareProcessor.cpp
@@ -17,8 +17,8 @@
*/
#include <platform/internal/CHIPDeviceLayerInternal.h>
-#include <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
-#include <platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.h>
+#include <platform/nxp/common/ota/OTAFirmwareProcessor.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
#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 b8bb3ab..1d17e35 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 <lib/support/Span.h>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
/* 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 84%
rename from src/platform/nxp/mcxw71_k32w1/OTAHooks.cpp
rename to src/platform/nxp/common/ota/OTAHooks.cpp
index c476e70..032fe3d 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 <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
#include <src/include/platform/CHIPDeviceLayer.h>
#include <src/app/clusters/ota-requestor/OTARequestorInterface.h>
-#include <platform/nxp/mcxw71_k32w1/OTAFirmwareProcessor.h>
+#include <platform/nxp/common/ota/OTAFirmwareProcessor.h>
#if CONFIG_CHIP_OTA_FACTORY_DATA_PROCESSOR
-#include <platform/nxp/common/legacy/OTAFactoryDataProcessor.h>
-#include <platform/nxp/mcxw71_k32w1/FactoryDataProviderImpl.h>
+#include <platform/nxp/common/factory_data/legacy/FactoryDataProviderImpl.h>
+#include <platform/nxp/common/ota/OTAFactoryDataProcessor.h>
#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 @@
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 @@
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 @@
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 c26a7da..f6f4236 100644
--- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.cpp
+++ b/src/platform/nxp/common/ota/OTAImageProcessorImpl.cpp
@@ -23,7 +23,7 @@
#include <src/app/clusters/ota-requestor/OTADownloader.h>
#include <src/app/clusters/ota-requestor/OTARequestorInterface.h>
-#include <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
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 9a862a7..3419cbd 100644
--- a/src/platform/nxp/common/legacy/OTAImageProcessorImpl.h
+++ b/src/platform/nxp/common/ota/OTAImageProcessorImpl.h
@@ -20,7 +20,7 @@
#include <lib/core/OTAImageHeader.h>
#include <map>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
#include <src/app/clusters/ota-requestor/OTADownloader.h>
#include <src/app/clusters/ota-requestor/OTARequestorInterface.h>
#include <src/include/platform/CHIPDeviceLayer.h>
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 e50da13..66a0801 100644
--- a/src/platform/nxp/common/legacy/OTATlvProcessor.cpp
+++ b/src/platform/nxp/common/ota/OTATlvProcessor.cpp
@@ -20,8 +20,8 @@
#include <lib/support/BufferReader.h>
#include <platform/internal/CHIPDeviceLayerInternal.h>
-#include <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
#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 0c9715b..e288e6a 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`
diff --git a/src/platform/nxp/k32w0/BLEManagerImpl.h b/src/platform/nxp/k32w0/BLEManagerImpl.h
index 686eb1e..b1aaa52 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 <src/platform/nxp/common/legacy/BLEManagerCommon.h>
+#include <src/platform/nxp/common/ble/BLEManagerCommon.h>
/* 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 a1b4050..6693acc 100644
--- a/src/platform/nxp/k32w0/BUILD.gn
+++ b/src/platform/nxp/k32w0/BUILD.gn
@@ -34,8 +34,8 @@
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 @@
}
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 b6777c7..9114906 100644
--- a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp
+++ b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.cpp
@@ -18,8 +18,8 @@
#include <lib/core/TLV.h>
#include <platform/internal/CHIPDeviceLayerInternal.h>
-#include <platform/nxp/common/legacy/CHIPDevicePlatformRamStorageConfig.h>
#include <platform/nxp/k32w0/CHIPDevicePlatformConfig.h>
+#include <platform/nxp/k32w0/CHIPDevicePlatformRamStorageConfig.h>
#include <platform/nxp/k32w0/FactoryDataProviderImpl.h>
#include <platform/nxp/k32w0/OTAFactoryDataProcessor.h>
diff --git a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h
index 3109e64..57b973d 100644
--- a/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h
+++ b/src/platform/nxp/k32w0/OTAFactoryDataProcessor.h
@@ -21,7 +21,7 @@
#include <lib/core/Optional.h>
#include <lib/support/ScopedBuffer.h>
#include <lib/support/Span.h>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
#include <platform/nxp/k32w0/FactoryDataProvider.h>
#include <platform/nxp/k32w0/FactoryDataProviderImpl.h>
diff --git a/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp b/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp
index c7a1a2b..3fcb2fd 100644
--- a/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp
+++ b/src/platform/nxp/k32w0/OTAFirmwareProcessor.cpp
@@ -17,7 +17,7 @@
*/
#include <platform/internal/CHIPDeviceLayerInternal.h>
-#include <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
#include <platform/nxp/k32w0/CHIPDevicePlatformConfig.h>
#include <platform/nxp/k32w0/OTAFirmwareProcessor.h>
diff --git a/src/platform/nxp/k32w0/OTAFirmwareProcessor.h b/src/platform/nxp/k32w0/OTAFirmwareProcessor.h
index 444243f..933a615 100644
--- a/src/platform/nxp/k32w0/OTAFirmwareProcessor.h
+++ b/src/platform/nxp/k32w0/OTAFirmwareProcessor.h
@@ -19,7 +19,7 @@
#pragma once
#include <lib/support/Span.h>
-#include <platform/nxp/common/legacy/OTATlvProcessor.h>
+#include <platform/nxp/common/ota/OTATlvProcessor.h>
namespace chip {
diff --git a/src/platform/nxp/k32w0/OTAHooks.cpp b/src/platform/nxp/k32w0/OTAHooks.cpp
index 30df881..659422d 100644
--- a/src/platform/nxp/k32w0/OTAHooks.cpp
+++ b/src/platform/nxp/k32w0/OTAHooks.cpp
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-#include <platform/nxp/common/legacy/OTAImageProcessorImpl.h>
+#include <platform/nxp/common/ota/OTAImageProcessorImpl.h>
#include <src/include/platform/CHIPDeviceLayer.h>
#include <src/app/clusters/ota-requestor/OTARequestorInterface.h>
diff --git a/src/platform/nxp/k32w0/args.gni b/src/platform/nxp/k32w0/args.gni
index 1076eea..fda5267 100644
--- a/src/platform/nxp/k32w0/args.gni
+++ b/src/platform/nxp/k32w0/args.gni
@@ -22,12 +22,6 @@
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"
diff --git a/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h b/src/platform/nxp/mcxw71_k32w1/BLEManagerImpl.h
index d2b38cd..1c51cd7 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 <src/platform/nxp/common/legacy/BLEManagerCommon.h>
+#include <src/platform/nxp/common/ble/BLEManagerCommon.h>
/* 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 9e19047..253e21e 100644
--- a/src/platform/nxp/mcxw71_k32w1/BUILD.gn
+++ b/src/platform/nxp/mcxw71_k32w1/BUILD.gn
@@ -32,10 +32,10 @@
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/FactoryDataDriverImpl.cpp",
+ "../common/factory_data/legacy/FactoryDataProvider.cpp",
+ "../common/factory_data/legacy/FactoryDataProviderImpl.cpp",
]
public = [
@@ -43,7 +43,7 @@
"${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_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/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",
]
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",
]
}
@@ -78,15 +78,25 @@
]
}
+config("nxp_platform_config") {
+ include_dirs = [
+ ".",
+ "../common/ble",
+ "../common/crypto",
+ "../common/factory_data/legacy",
+ "../common/ota",
+ ]
+}
+
static_library("nxp_platform") {
deps = []
defines = [ "CHIP_DEVICE_K32W1=1" ]
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 +109,6 @@
"PlatformManagerImpl.cpp",
"PlatformManagerImpl.h",
"SystemTimeSupport.cpp",
- "ble_function_mux.c",
]
if (chip_key_storage == "fwk_nvm") {
@@ -151,6 +160,7 @@
"${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",
]
@@ -163,9 +173,9 @@
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) {
@@ -208,4 +218,6 @@
"${chip_root}/src/platform:syscalls_stub",
"${chip_root}/src/platform/logging:headers",
]
+
+ public_configs = [ ":nxp_platform_config" ]
}
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 ed3a643..0000000
--- 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 8b9417d..0000000
--- 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
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 604fcfb..0000000
--- 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 938968b..0000000
--- 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 <<gattDb.h>>
-* -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/third_party/nxp/nxp_matter_support b/third_party/nxp/nxp_matter_support
index f6329bb..21d1862 160000
--- a/third_party/nxp/nxp_matter_support
+++ b/third_party/nxp/nxp_matter_support
@@ -1 +1 @@
-Subproject commit f6329bb2280c8bc3f50f6d39e79191499e67cffa
+Subproject commit 21d18627ad46710dfb863080c1047cdbaf556d25