Skip to content

Commit c1f14c6

Browse files
temp: Add subsys to check doc build
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
1 parent 646c2a9 commit c1f14c6

6 files changed

Lines changed: 407 additions & 0 deletions

File tree

subsys/Kconfig

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if CHIP
8+
9+
config MATTER_APP_TASK_QUEUE_SIZE
10+
int "Maximum number of tasks delegated to be run in the application queue"
11+
default 10
12+
help
13+
Define the maximum size of the queue dedicated for application tasks that
14+
have to be run in the application thread context.
15+
16+
config MATTER_APP_TASK_MAX_SIZE
17+
int "Maximum size of application task in bytes"
18+
default 16
19+
help
20+
Defines the maximum size of a functor that can be put in the application
21+
thread's task queue.
22+
23+
config MATTER_CUSTOM_BLUETOOTH_ADVERTISING
24+
bool "Define the custom behavior of the Bluetooth advertisement in the application code"
25+
help
26+
Disable the default Bluetooth advertising start which is defined in the board.cpp file and
27+
allows to use the custom one.
28+
29+
config MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS
30+
bool "Operational keys migration feature"
31+
depends on CHIP_CRYPTO_PSA
32+
help
33+
Enables migration of the operational keys stored in the persistent storage to the PSA ITS secure storage.
34+
Enable this feature while updating the firmware of in-field devices that run Mbed TLS cryptography backend
35+
to the firmware based on PSA Crypto API.
36+
37+
config MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE
38+
bool "Perform factory reset if the operational key migration failed"
39+
default y
40+
depends on MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS
41+
help
42+
Allow device to perform factory reset if the operational key for Fabric has not been migrated
43+
properly to PSA ITS storage.
44+
45+
config MATTER_LEDS
46+
bool "LEDs usage"
47+
default y
48+
depends on DK_LIBRARY
49+
help
50+
Enables LEDs module to be used in the application.
51+
52+
config MATTER_SETTINGS_SHELL
53+
bool "Settings shell for Matter purposes"
54+
default y if CHIP_MEMORY_PROFILING
55+
depends on SHELL
56+
depends on NVS || ZMS
57+
help
58+
Allows using matter_settings shell commands.
59+
You can use the following commands:
60+
peak - to read the maximum settings usage.
61+
reset - to reset peak value.
62+
get_size - to read the size of specific value.
63+
current - to read current settings usage.
64+
free - to read free settings space.
65+
66+
config MATTER_TEST_EVENT_TRIGGERS
67+
bool "Test event triggers support"
68+
default y
69+
help
70+
Enables support for test event triggers for the specific use-cases.
71+
72+
config MATTER_TEST_EVENT_TRIGGERS_MAX
73+
int "Maximum amount of event triggers"
74+
default 8
75+
depends on MATTER_TEST_EVENT_TRIGGERS
76+
help
77+
Defines the maximum amount of event triggers.
78+
79+
config MATTER_TEST_EVENT_TRIGGERS_REGISTER_DEFAULTS
80+
bool "Register default triggers for Matter sample"
81+
depends on MATTER_TEST_EVENT_TRIGGERS
82+
default y
83+
help
84+
Automatically register default triggers such as factory reset,
85+
device reboot, OTA start query.
86+
87+
config MATTER_TEST_EVENT_TRIGGERS_MAX_TRIGGERS_DELEGATES
88+
int "Maximum amount of the trigger delegates"
89+
default 3
90+
depends on MATTER_TEST_EVENT_TRIGGERS
91+
help
92+
Defines the maximum number for the TestEventTriggerDelegate implementations
93+
to be registered in the nRF test event triggers class.
94+
95+
config MATTER_TEST_SHELL
96+
bool "Test - specific shell commands support for Matter samples"
97+
depends on CHIP_LIB_SHELL
98+
help
99+
Enables support for test - specific shell commands in Matter samples.
100+
101+
config MATTER_PERSISTENT_STORAGE
102+
bool "Persistent storage support for Matter samples"
103+
help
104+
Matter persistent storage support with the configurable backend.
105+
106+
config MATTER_ZAP_FILE_PATH
107+
string "Path in sample, under which ZAP file is located"
108+
help
109+
Absolute path to location under which ZAP file is located.
110+
It shall contain the file name and .zap extension.
111+
112+
config MATTER_CERTIFICATION
113+
bool "Patches for Matter platform certification"
114+
help
115+
It enables including software patches required for the Matter platform certification
116+
purposes. Currently it works only with the Matter template sample.
117+
118+
config MATTER_USE_DEFAULT_BUTTON_HANDLER
119+
bool "Use default button handler alongside the application one"
120+
default y
121+
help
122+
When enabled, the button handler responsible for factory reset and DFU is used alongside
123+
application handler. In order to override this handler, disable this config.
124+
125+
choice MATTER_ZAP_GENERATION_MODE
126+
prompt "Matter ZAP generation mode"
127+
default MATTER_ZAP_GENERATION_STATIC
128+
129+
config MATTER_ZAP_GENERATION_BUILD_TIME
130+
bool "Generate ZAP artifacts at build time"
131+
132+
config MATTER_ZAP_GENERATION_STATIC
133+
bool "Use pre-generated ZAP artifacts"
134+
endchoice
135+
136+
rsource "persistent_storage/Kconfig"
137+
rsource "watchdog/Kconfig"
138+
rsource "diagnostic/Kconfig"
139+
140+
endif # CHIP

subsys/diagnostic/Kconfig

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
menuconfig MATTER_DIAGNOSTIC_LOGS
8+
bool "Diagnostics logs support"
9+
imply CHIP_ENABLE_BDX_LOG_TRANSFER
10+
help
11+
Provides support for diagnostics logs. Diagnostics logs allow the Matter controller to read end-user,
12+
network and crash logs from the Matter device.
13+
Diagnostic logs are usable only if the DiagnosticCluster is available and active on the device's root endpoint.
14+
Otherwise, the compilation error occurs.
15+
16+
if MATTER_DIAGNOSTIC_LOGS
17+
18+
config MATTER_DIAGNOSTIC_LOGS_MAX_SIMULTANEOUS_SESSIONS
19+
int "Define maximum simultaneous sessions"
20+
default 20
21+
help
22+
The maximum simultaneous sessions, which is the capability for sending diagnostic logs
23+
to Matter controller using multiple sessions at the same time for different diagnostic
24+
intents. When a session finishes, it releases its slot for a new one.
25+
26+
config MATTER_DIAGNOSTIC_LOGS_CRASH_LOGS
27+
bool "Crash logs support"
28+
select RETAINED_MEM
29+
select RETENTION
30+
select RETENTION_MUTEX_FORCE_DISABLE
31+
select RETAINED_MEM_MUTEX_FORCE_DISABLE
32+
help
33+
Enables support for storing crash logs when the crash occurs.
34+
35+
if MATTER_DIAGNOSTIC_LOGS_CRASH_LOGS
36+
37+
config MATTER_DIAGNOSTIC_LOGS_REMOVE_CRASH_AFTER_READ
38+
bool "Remove the last crash data after read"
39+
help
40+
Removes the last crash data after reading it by Matter controller.
41+
Disable this option to read the last crash multiple times.
42+
43+
endif # MATTER_DIAGNOSTIC_LOGS_CRASH_LOGS
44+
45+
config MATTER_DIAGNOSTIC_LOGS_END_USER_LOGS
46+
bool "End user logs support"
47+
help
48+
Enables support for capturing end user diagnostic logs.
49+
50+
config MATTER_DIAGNOSTIC_LOGS_NETWORK_LOGS
51+
bool "Network logs support"
52+
help
53+
Enables support for capturing network diagnostic logs.
54+
55+
config MATTER_DIAGNOSTIC_LOGS_TEST
56+
bool "Testing module for Diagnostic logs cluster"
57+
help
58+
Enables testing module for diagnostic logs cluster.
59+
60+
config MATTER_DIAGNOSTIC_LOGS_REDIRECT
61+
bool "Redirection of logs to the diagnostic logs module"
62+
default y if MATTER_DIAGNOSTIC_LOGS_END_USER_LOGS || MATTER_DIAGNOSTIC_LOGS_NETWORK_LOGS
63+
depends on LOG_MODE_DEFERRED
64+
help
65+
Enable redirection of the logs formed using logger LOG macro to the Matter diagnostic logs module.
66+
This option enables only redirection logs from the "chip" module, as a diagnostic network logs
67+
and from the "app" module, as a diagnostic end user logs.
68+
69+
endif # MATTER_DIAGNOSTIC_LOGS
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "migration_manager.h"
8+
9+
#include "app/group_data_provider.h"
10+
11+
#include <crypto/OperationalKeystore.h>
12+
#include <crypto/PersistentStorageOperationalKeystore.h>
13+
14+
#include <zephyr/logging/log.h>
15+
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
16+
17+
namespace Nrf::Matter
18+
{
19+
namespace Migration
20+
{
21+
#ifdef CONFIG_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS
22+
CHIP_ERROR MoveOperationalKeysFromKvsToIts(chip::PersistentStorageDelegate *storage,
23+
chip::Crypto::OperationalKeystore *keystore)
24+
{
25+
CHIP_ERROR err = CHIP_NO_ERROR;
26+
27+
VerifyOrReturnError(keystore && storage, CHIP_ERROR_INVALID_ARGUMENT);
28+
29+
/* Initialize the obsolete Operational Keystore*/
30+
chip::PersistentStorageOperationalKeystore obsoleteKeystore;
31+
err = obsoleteKeystore.Init(storage);
32+
VerifyOrReturnError(err == CHIP_NO_ERROR, err);
33+
34+
/* Migrate all obsolete Operational Keys to PSA ITS */
35+
for (const chip::FabricInfo &fabric : chip::Server::GetInstance().GetFabricTable()) {
36+
err = keystore->MigrateOpKeypairForFabric(fabric.GetFabricIndex(), obsoleteKeystore);
37+
if (CHIP_NO_ERROR != err) {
38+
LOG_ERR("Cannot migrate %d fabric to PSA crypto storage", fabric.GetFabricIndex());
39+
break;
40+
}
41+
}
42+
43+
#ifdef CONFIG_MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE
44+
if (CHIP_NO_ERROR != err) {
45+
LOG_ERR("Keystore migration failure due to %s. Performing Factory reset...", err.AsString());
46+
chip::Server::GetInstance().ScheduleFactoryReset();
47+
/* Return a success to not block the Matter event Loop and allow to call scheduled factory
48+
* reset. */
49+
err = CHIP_NO_ERROR;
50+
}
51+
#endif /* CONFIG_MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE */
52+
53+
return err;
54+
}
55+
#endif /* CONFIG_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS */
56+
} /* namespace Migration */
57+
} /* namespace Nrf::Matter */
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#pragma once
8+
9+
#include <app/server/Server.h>
10+
11+
namespace Nrf::Matter
12+
{
13+
namespace Migration
14+
{
15+
#ifdef CONFIG_MATTER_OPERATIONAL_KEYS_MIGRATION_TO_ITS
16+
/**
17+
* @brief Migrate all stored Operational Keys from the persistent storage (KVS) to secure PSA ITS.
18+
*
19+
* This function will schedule a factory reset automatically if the
20+
* CONFIG_MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE
21+
* Kconfig option is set to 'y'. In this case, the function returns CHIP_NO_ERROR to not block any further
22+
* operations until the scheduled factory reset is done.
23+
*
24+
* @note This function should be called just after Matter Server Init to avoid problems with further CASE
25+
* session re-establishments.
26+
* @param storage
27+
* @param keystore
28+
* @retval CHIP_NO_ERROR if all keys have been migrated properly to PSA ITS or if the error occurs, but
29+
* the CONFIG_MATTER_FACTORY_RESET_ON_KEY_MIGRATION_FAILURE kconfig is set to 'y'.
30+
* @retval CHIP_ERROR_INVALID_ARGUMENT when keystore or storage are not defined.
31+
* @retval Other CHIP_ERROR codes related to internal Migration operations.
32+
*/
33+
CHIP_ERROR MoveOperationalKeysFromKvsToIts(chip::PersistentStorageDelegate *storage,
34+
chip::Crypto::OperationalKeystore *keystore);
35+
#endif
36+
} /* namespace Migration */
37+
} /* namespace Nrf::Matter */

subsys/persistent_storage/Kconfig

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
if MATTER_PERSISTENT_STORAGE
8+
9+
config MATTER_SETTINGS_STORAGE_BACKEND
10+
bool "Settings based storage implementation for Matter samples"
11+
depends on SETTINGS
12+
default y
13+
14+
config MATTER_SECURE_STORAGE_BACKEND
15+
bool "Secure storage implementation for Matter samples [DEPRECATED]"
16+
select TRUSTED_STORAGE if (!PSA_SSF_CRYPTO_CLIENT && !BUILD_WITH_TFM)
17+
select PSA_PROTECTED_STORAGE if (!PSA_SSF_CRYPTO_CLIENT && !BUILD_WITH_TFM)
18+
select DEPRECATED
19+
help
20+
Enables the secure persistent storage wrapper API that
21+
imitates Zephyr Settings' key-value data format.
22+
If building with CMSE enabled (*/ns), the TF-M
23+
and Secure Domain PSA Protected Storage implementation
24+
is leveraged by default.
25+
If building with CMSE disabled (*/cpuapp),
26+
the Trusted Storage library must be used.
27+
28+
config MATTER_STORAGE_MAX_KEY_LEN
29+
int "Maximum length (bytes) of the key under which the asset can be stored"
30+
default 18
31+
32+
if MATTER_SECURE_STORAGE_BACKEND
33+
34+
config MATTER_SECURE_STORAGE_MAX_ENTRY_NUMBER
35+
int "Maximum number of entries that can be stored securely"
36+
default 64
37+
38+
config MATTER_SECURE_STORAGE_PSA_KEY_VALUE_OFFSET
39+
hex "The PSA key offset dedicated for Matter application"
40+
default 0x40000
41+
42+
config TRUSTED_STORAGE_BACKEND_AEAD_MAX_DATA_SIZE
43+
default 1410
44+
45+
endif
46+
47+
endif

0 commit comments

Comments
 (0)