Skip to content

Commit ed86881

Browse files
kkasperczyk-noArekBalysNordicmarkaj-nordicDamian-NordicLuDuda
authored
V1.3 nrf cherry picks (project-chip#33134)
* [nrfconnect][zephyr] Improvements and Fixes for WiFi according to NCS 2.6.0 (project-chip#32711) * [nrfconnect] wifi: avoid unwanted connect request It's pointless to issue a connect request in case no valid SSID has been found. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * [nrfconnect] wifi: Fix 5GHz association Wi-Fi stack recently introduced a check for valid band value and the default value of 0 (memset) means only 2.4GHz, so, 5GHz Wi-Fi associations will fail. Fix the default to Unknown to scan all supported bands. * [zephyr][nrfconnect] Make Wi-Fi manager use Wi-Fi interface only Find the Wi-Fi interface at the Wi-Fi manager initialization and use that interface instead of the default interface when calling Wi-Fi management functions. Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> * [nrfconnect] fix handling of LastNetworkID in Wi-Fi driver This commit makes sure that correct Network ID is provided to the Network Commissioning cluster from the platform's Wi-Fi driver. Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no> * [inet] Combine platform handlers for joining/leaving mcast group Instead, use a single handler for both joining and leaving a multicast group to reduce the code duplication. Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> * [zephyr][nrfconnect] Move handler for joining/leaving mcast group Move the platform handler for joining and leaving a multicast group to ConnectivityManagerImpl to support Matter stack on a system with multiple network interfaces (Thread + Wi-Fi). Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> * [nrfconnect] Added DNS server refresh after adding new IPv6 address The Wi-Fi device does not update mDNS queries after obtaining new IPv6 GUA address, so for some time after assigning prefix, the Thread Border Routers still use cached link-local address, which is not routable. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> * [nrfconnect] [zephyr] Disable synchronous printk Disable synchronous printk to avoid blocking IRQs which may affect time sensitive components (like 15.4 radio). Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * [nrfconnect] Fix various Wi-Fi issues with error code handling This commit handles a few issues with Wi-Fi connection or scanning: - Use wifi_status structure instead of incompatible WiFiRequestStatus - On connect error value > 2 do not report success - On scan error value > 1 do not report success - Provide value of mandatory LastConnectErrorValue attribute Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no> * [nrfconnect] Minor Wi-Fi refinements * error code handling unification * added GetWantedNetwork getter and use it when handling network status change * minor refactoring Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * Restyled by clang-format * [nrfconnect] Provide a workaround for nrfconnect Posix unit tests. We need to disable all dependencies to the Zephyr net_if module until we switch unit tests to it. * Restyled by gn * Use Enum to indicate an operation instead of bool in MulticastGroupHandler --------- Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no> Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> Co-authored-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Co-authored-by: Damian Krolik <damian.krolik@nordicsemi.no> Co-authored-by: Łukasz Duda <lukasz.duda@nordicsemi.no> Co-authored-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> Co-authored-by: Restyled.io <commits@restyled.io> * [nrfconnect] Improve CHIP_MEMORY_PROFILING config (project-chip#32827) - Enabled the full SHELL option when memory profiling is enabled. * [dnssd] Allow selecting DNS-SD implementation at runtime (project-chip#32829) Add Resolver::SetInstance() and ServiceAdvertiser::SetInstance() methods for dynamically changing the system-wide DNS-SD implementation used by Matter. Also, allow for building "minimal" and "platform" DNS-SD implementations together. Co-authored-by: Damian Krolik <damian.krolik@nordicsemi.no> * [scripts] Fixed nrfconnect factory generation scripts (project-chip#32892) The factory_data.hex file is not generated as an intermediate product of factory generation process. In result, factory generation works only if merging with firmware is used or scripts are manually invoked. Added optional --size and --offset arguments to generate_nrfconnect_chip_factory_data.py script that results in calling nrfconnect_generate_partition.py internally. It solves an issue and additionally simplifies manual generation process (if selected). * [nrfconnect] Implemented WiFiNetworkDiagnostics events generation (project-chip#32962) * Added generation of optional events from WiFiNetworkDiagnostics cluster. * Improved handler methods to validate the input data size * [zephyr] Fix CHIPDevicePlatformEvent.h include dependency (project-chip#33004) Currently the CHIPDevicePlatformEvent depends on the SystemPacketBuffer which is included in the CHIPDeviceEvent.h too late. The problem is silently worked around in the application when the <platform/PlatformManager.h> include is preceded by other headers that pull in SystemPacketBuffer.h, but we need a proper fix. Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> * [zephyr] Added Bluetooth LE Extended Advertisement option (project-chip#33005) This commit implements platform solution for a Bluetooth LE extended advertising. Additionally, for the CommissioningWindowManager types were changed from Seconds16 to Seconds32, because the current implementation overflows for 48h duration. Co-authored-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no> * [clusters] Implemented ThreadDiagnosticDelegate (project-chip#32964) Added ThreadDiagnosticDelegate to enable generation of optional events from ThreadNetworkDiagnostics cluster. Additionally implemented generation of ConnectionStatus and NetworkFaultChanged events when Thread link state is changed. --------- Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no> Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no> Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no> Co-authored-by: Arkadiusz Bałys <arkadiusz.balys@nordicsemi.no> Co-authored-by: Marcin Kajor <marcin.kajor@nordicsemi.no> Co-authored-by: Damian Krolik <damian.krolik@nordicsemi.no> Co-authored-by: Łukasz Duda <lukasz.duda@nordicsemi.no> Co-authored-by: Restyled.io <commits@restyled.io> Co-authored-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
1 parent 530dec2 commit ed86881

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+901
-360
lines changed

config/nrfconnect/chip-module/CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_ST
140140
matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT)
141141
matter_add_gn_arg_bool ("chip_enable_factory_data" CONFIG_CHIP_FACTORY_DATA)
142142
matter_add_gn_arg_bool ("chip_enable_read_client" CONFIG_CHIP_ENABLE_READ_CLIENT)
143+
matter_add_gn_arg_bool ("chip_mdns_minimal" CONFIG_WIFI_NRF700X)
144+
matter_add_gn_arg_bool ("chip_mdns_platform" CONFIG_NET_L2_OPENTHREAD)
143145

144146
if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
145147
matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT)
@@ -157,10 +159,10 @@ if (CONFIG_CHIP_ROTATING_DEVICE_ID)
157159
matter_add_gn_arg_bool("chip_enable_additional_data_advertising" TRUE)
158160
endif()
159161

160-
if (CONFIG_NET_L2_OPENTHREAD)
161-
matter_add_gn_arg_string("chip_mdns" "platform")
162-
elseif(CONFIG_WIFI_NRF700X)
162+
if(CONFIG_WIFI_NRF700X)
163163
matter_add_gn_arg_string("chip_mdns" "minimal")
164+
elseif (CONFIG_NET_L2_OPENTHREAD)
165+
matter_add_gn_arg_string("chip_mdns" "platform")
164166
else()
165167
matter_add_gn_arg_string("chip_mdns" "none")
166168
endif()

config/nrfconnect/chip-module/Kconfig.defaults

+3-3
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,10 @@ config SHELL_STACK_SIZE
452452
default 2616 if CHIP_WIFI
453453

454454
config SHELL_MINIMAL
455-
default y
455+
default y if !CHIP_MEMORY_PROFILING
456456

457457
config KERNEL_SHELL
458-
default n
458+
default n if !CHIP_MEMORY_PROFILING
459459

460460
config SENSOR_SHELL
461461
default n
@@ -482,7 +482,7 @@ config HWINFO_SHELL
482482
default n
483483

484484
config OPENTHREAD_SHELL
485-
default n
485+
default n if !CHIP_MEMORY_PROFILING
486486

487487
endif # SHELL
488488

config/nrfconnect/chip-module/Kconfig.features

+7-2
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,20 @@ endif # CHIP_SPI_NOR
7575

7676
config CHIP_MEMORY_PROFILING
7777
bool "Enable features for tracking memory usage"
78+
# Matter stack
7879
select CHIP_STATISTICS
80+
# Heap
7981
select CHIP_MALLOC_SYS_HEAP_WATERMARKS_SUPPORT if CHIP_MALLOC_SYS_HEAP
82+
select SYS_HEAP_RUNTIME_STATS if CHIP_MALLOC_SYS_HEAP
83+
# Crypto
8084
select MBEDTLS_MEMORY_DEBUG if !CHIP_CRYPTO_PSA
81-
select SYS_HEAP_RUNTIME_STATS if CHIP_MALLOC_SYS_HEAP
82-
select KERNEL_SHELL
85+
# Network
8386
select NET_STATISTICS
8487
select NET_SHELL
8588
select NET_BUF_POOL_USAGE
8689
select OPENTHREAD_SHELL if !CHIP_WIFI
90+
# Zephyr
91+
select KERNEL_SHELL
8792
help
8893
Enables features for tracking memory usage in Matter.
8994

config/nrfconnect/chip-module/generate_factory_data.cmake

+22-61
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,29 @@
1515
#
1616

1717

18-
# Create a JSON file based on factory data given via kConfigs.
18+
# Create a .hex file in CBOR format based on factory data given via kConfigs.
1919
#
2020
# This function creates a list of arguments for external script and then run it to write a JSON file.
2121
# Created JSON file can be checked using JSON SCHEMA file if it is provided.
22+
# Next, the resulting .hex file is generated based on previously created JSON file.
2223
#
2324
# This script can be manipulated using following kConfigs:
2425
# - To merge generated factory data with final zephyr.hex file set kConfig CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE=y
2526
# - To use default certification paths set CONFIG_CHIP_FACTORY_DATA_USE_DEFAULTS_CERTS_PATH=y
2627
#
27-
# During generation process a some file will be created in zephyr's build directory:
28+
# During generation process the following files will be created in zephyr's build directory:
2829
# - <factory_data_target>.json a file containing all factory data written in JSON format.
30+
# - <factory_data_target>.hex a file containing all factory data in CBOR format.
31+
# - <factory_data_target>.bin a binary file containing all raw factory data in CBOR format.
32+
# - <factory_data_target>.cbor a file containing all factory data in CBOR format.
2933
#
3034
# [Args]:
3135
# factory_data_target - a name for target to generate factory_data.
3236
# script_path - a path to script that makes a JSON factory data file from given arguments.
3337
# schema_path - a path to JSON schema file which can be used to verify generated factory data JSON file.
3438
# This argument is optional, if you don't want to verify the JSON file put it empty "".
35-
# output_path - a path to output directory, where created JSON file will be stored.
36-
function(nrfconnect_create_factory_data_json factory_data_target script_path schema_path output_path)
39+
# output_path - a path to output directory, where created hex and JSON files will be stored.
40+
function(nrfconnect_create_factory_data factory_data_target script_path schema_path output_path)
3741

3842
# set script args for future purpose
3943
set(script_args)
@@ -120,62 +124,25 @@ if(CONFIG_CHIP_DEVICE_ENABLE_KEY)
120124
string(APPEND script_args "--enable_key \"${CONFIG_CHIP_DEVICE_ENABLE_KEY}\"\n")
121125
endif()
122126

123-
# Set output JSON file and path to SCHEMA file to validate generated factory data
124-
set(factory_data_json ${output_path}/${factory_data_target}.json)
125-
string(APPEND script_args "-o \"${factory_data_json}\"\n")
127+
# Set output path and path to SCHEMA file to validate generated factory data
128+
set(factory_data_output_path ${output_path}/${factory_data_target})
129+
string(APPEND script_args "-o \"${factory_data_output_path}\"\n")
126130
string(APPEND script_args "-s \"${schema_path}\"\n")
127131

132+
# Add optional offset and size arguments to generate both .hex and .json files.
133+
string(APPEND script_args "--offset $<TARGET_PROPERTY:partition_manager,PM_FACTORY_DATA_ADDRESS>\n")
134+
string(APPEND script_args "--size $<TARGET_PROPERTY:partition_manager,PM_FACTORY_DATA_OFFSET>\n")
135+
128136
# execute first script to create a JSON file
129137
separate_arguments(separated_script_args NATIVE_COMMAND ${script_args})
130138
add_custom_command(
131-
OUTPUT ${factory_data_json}
139+
OUTPUT ${factory_data_output_path}.hex
132140
DEPENDS ${FACTORY_DATA_SCRIPT_PATH}
133141
COMMAND ${Python3_EXECUTABLE} ${FACTORY_DATA_SCRIPT_PATH} ${separated_script_args}
134142
COMMENT "Generating new Factory Data..."
135143
)
136144
add_custom_target(${factory_data_target} ALL
137-
DEPENDS ${factory_data_json}
138-
)
139-
140-
endfunction()
141-
142-
143-
# Create a .hex file with factory data in CBOR format.
144-
#
145-
# This function creates a .hex and .cbor files from given JSON factory data file.
146-
#
147-
#
148-
# During generation process some files will be created in zephyr's build directory:
149-
# - <factory_data_target>.hex a file containing all factory data in CBOR format.
150-
# - <factory_data_target>.bin a binary file containing all raw factory data in CBOR format.
151-
# - <factory_data_target>.cbor a file containing all factory data in CBOR format.
152-
#
153-
# [Args]:
154-
# factory_data_hex_target - a name for target to generate factory data HEX file.
155-
# factory_data_target - a name for target to generate factory data JSON file.
156-
# script_path - a path to script that makes a factory data .hex file from given arguments.
157-
# output_path - a path to output directory, where created JSON file will be stored.
158-
function(nrfconnect_create_factory_data_hex_file factory_data_hex_target factory_data_target script_path output_path)
159-
160-
# Pass the argument list via file
161-
set(cbor_script_args "-i ${output_path}/${factory_data_target}.json\n")
162-
string(APPEND cbor_script_args "-o ${output_path}/${factory_data_target}\n")
163-
# get partition address and offset from partition manager during compilation
164-
string(APPEND cbor_script_args "--offset $<TARGET_PROPERTY:partition_manager,PM_FACTORY_DATA_ADDRESS>\n")
165-
string(APPEND cbor_script_args "--size $<TARGET_PROPERTY:partition_manager,PM_FACTORY_DATA_OFFSET>\n")
166-
string(APPEND cbor_script_args "-r\n")
167-
168-
# execute second script to create a hex file containing factory data in cbor format
169-
separate_arguments(separated_cbor_script_args NATIVE_COMMAND ${cbor_script_args})
170-
set(factory_data_hex ${output_path}/${factory_data_target}.hex)
171-
172-
add_custom_command(OUTPUT ${factory_data_hex}
173-
COMMAND ${Python3_EXECUTABLE} ${script_path} ${separated_cbor_script_args}
174-
COMMENT "Generating factory data HEX file..."
175-
DEPENDS ${factory_data_target} ${script_path}
176-
)
177-
add_custom_target(${factory_data_hex_target}
178-
DEPENDS ${factory_data_hex}
145+
DEPENDS ${factory_data_output_path}.hex
179146
)
180147

181148
endfunction()
@@ -202,22 +169,16 @@ set(GENERATE_CBOR_SCRIPT_PATH ${CHIP_ROOT}/scripts/tools/nrfconnect/nrfconnect_g
202169
set(FACTORY_DATA_SCHEMA_PATH ${CHIP_ROOT}/scripts/tools/nrfconnect/nrfconnect_factory_data.schema)
203170
set(OUTPUT_FILE_PATH ${APPLICATION_BINARY_DIR}/zephyr)
204171

205-
# create a JSON file with all factory data
206-
nrfconnect_create_factory_data_json(factory_data
207-
${FACTORY_DATA_SCRIPT_PATH}
208-
${FACTORY_DATA_SCHEMA_PATH}
209-
${OUTPUT_FILE_PATH})
210-
211172
# create a .hex file with factory data in CBOR format based on the JSON file created previously
212-
nrfconnect_create_factory_data_hex_file(factory_data_hex
213-
factory_data
214-
${GENERATE_CBOR_SCRIPT_PATH}
215-
${OUTPUT_FILE_PATH})
173+
nrfconnect_create_factory_data(factory_data
174+
${FACTORY_DATA_SCRIPT_PATH}
175+
${FACTORY_DATA_SCHEMA_PATH}
176+
${OUTPUT_FILE_PATH})
216177

217178
if(CONFIG_CHIP_FACTORY_DATA_MERGE_WITH_FIRMWARE)
218179
# set custom target for merging factory_data hex file
219180
set_property(GLOBAL PROPERTY factory_data_PM_HEX_FILE ${OUTPUT_FILE_PATH}/factory_data.hex)
220-
set_property(GLOBAL PROPERTY factory_data_PM_TARGET factory_data_hex)
181+
set_property(GLOBAL PROPERTY factory_data_PM_TARGET factory_data)
221182
endif()
222183

223184

config/zephyr/Kconfig

+18
Original file line numberDiff line numberDiff line change
@@ -533,4 +533,22 @@ config CHIP_OTA_IMAGE_EXTRA_ARGS
533533

534534
endif
535535

536+
config CHIP_BLE_EXT_ADVERTISING
537+
bool "Bluetooth LE extended advertising"
538+
help
539+
Enable Bluetooth LE extended advertising, which allows the device to advertise
540+
Matter service over Bluetooth LE for a period of time longer than 15 minutes.
541+
If this config is true,
542+
CHIP_DEVICE_CONFIG_DISCOVERY_TIMEOUT_SECS define can be set up to 172800 seconds (48h).
543+
544+
config CHIP_BLE_ADVERTISING_DURATION
545+
int "Bluetooth LE advertising duration in minutes"
546+
range 15 2880 if CHIP_BLE_EXT_ADVERTISING
547+
range 0 15
548+
default 15
549+
help
550+
Specify how long the device will advertise Matter service over Bluetooth LE in minutes.
551+
If CHIP_BLE_EXT_ADVERTISING is set to false, the maximum duration time is 15 minutes,
552+
else the maximum duration time can be extended to 2880 minutes (48h).
553+
536554
endif

config/zephyr/chip-module/Kconfig.defaults

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ config LOG_DEFAULT_LEVEL
4040

4141
endif
4242

43+
# disable synchronous printk to avoid blocking IRQs which
44+
# may affect time sensitive components
4345
config PRINTK_SYNC
4446
bool
45-
default y
47+
default n
4648

4749
config ASSERT
4850
bool

docs/guides/nrfconnect_factory_data_configuration.md

+58-19
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data secure by applying hardware write protection.
3737
- [Appearance field description](#appearance-field-description)
3838
- [Enabling factory data support](#enabling-factory-data-support)
3939
- [Generating factory data](#generating-factory-data)
40-
- [Creating the factory data JSON file with the first script](#creating-the-factory-data-json-file-with-the-first-script)
40+
- [Creating the factory data JSON and HEX files with the first script](#creating-the-factory-data-json-and-hex-files-with-the-first-script)
4141
- [How to set user data](#how-to-set-user-data)
4242
- [How to handle user data](#how-to-handle-user-data)
4343
- [Verifying using the JSON Schema tool](#verifying-using-the-json-schema-tool)
@@ -218,14 +218,19 @@ file written in another way. To make sure that the JSON file is correct and the
218218
device is able to read out parameters,
219219
[verify the file using the JSON schema tool](#verifying-using-the-json-schema-tool).
220220

221-
### Creating the factory data JSON file with the first script
221+
You can also use only the first script to generate both JSON and HEX files, by
222+
providing optional `offset` and `size` arguments, which results in invoking the
223+
script internally. Such option is the recommended one, but invoking two scripts
224+
one by one is also supported to provide backward compatibility.
225+
226+
### Creating the factory data JSON and HEX files with the first script
222227

223228
A Matter device needs a proper factory data partition stored in the flash memory
224229
to read out all required parameters during startup. To simplify the factory data
225230
generation, you can use the
226231
[generate_nrfconnect_chip_factory_data.py](../../scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py)
227232
Python script to provide all required parameters and generate a human-readable
228-
JSON file.
233+
JSON file and save it to a HEX file.
229234

230235
To use this script, complete the following steps:
231236

@@ -245,10 +250,10 @@ To use this script, complete the following steps:
245250
--sn --vendor_id, --product_id, --vendor_name, --product_name, --date, --hw_ver, --hw_ver_str, --spake2_it, --spake2_salt, --discriminator
246251
```
247252
248-
b. Add output file path:
253+
b. Add output path to store .json file, e.g. my_dir/output:
249254
250255
```
251-
-o <path_to_output_json_file>
256+
-o <path_to_output_file>
252257
```
253258
254259
c. Generate SPAKE2 verifier using one of the following methods:
@@ -341,6 +346,34 @@ To use this script, complete the following steps:
341346
> `chip-cert` executable. See the note at the end of this section to learn
342347
> how to get it.
343348
349+
k. (optional) Partition offset that is an address in device's NVM memory,
350+
where factory data will be stored.
351+
352+
```
353+
--offset <offset>
354+
```
355+
356+
> **Note:** To generate a HEX file with factory data, you need to provide
357+
> both `offset` and `size` optional arguments. As a result,
358+
> `factory_data.hex` and `factory_data.bin` files are created in the
359+
> `output` directory. The first file contains the required memory offset.
360+
> For this reason, it can be programmed directly to the device using a
361+
> programmer (for example, `nrfjprog`).
362+
363+
l. (optional) The maximum partition size in device's NVM memory, where
364+
factory data will be stored.
365+
366+
```
367+
--size <size>
368+
```
369+
370+
> **Note:** To generate a HEX file with factory data, you need to provide
371+
> both `offset` and `size` optional arguments. As a result,
372+
> `factory_data.hex` and `factory_data.bin` files are created in the
373+
> `output` directory. The first file contains the required memory offset.
374+
> For this reason, it can be programmed directly to the device using a
375+
> programmer (for example, `nrfjprog`).
376+
344377
4. Run the script using the prepared list of arguments:
345378
346379
```
@@ -370,8 +403,10 @@ $ python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py \
370403
--passcode 20202021 \
371404
--product_finish "matte" \
372405
--product_color "black" \
373-
--out "build.json" \
374-
--schema "scripts/tools/nrfconnect/nrfconnect_factory_data.schema"
406+
--out "build" \
407+
--schema "scripts/tools/nrfconnect/nrfconnect_factory_data.schema" \
408+
--offset 0xf7000 \
409+
--size 0x1000
375410
```
376411
377412
As the result of the above example, a unique ID for the rotating device ID is
@@ -570,7 +605,7 @@ To generate a manual pairing code and a QR code, complete the following steps:
570605
```
571606
572607
2. Complete steps 1, 2, and 3 from the
573-
[Creating the factory data JSON file with the first script](#creating-the-factory-data-json-file-with-the-first-script)
608+
[Creating the factory data JSON and HEX files with the first script](#creating-the-factory-data-json-and-hex-files-with-the-first-script)
574609
section to prepare the final invocation of the Python script.
575610
576611
3. Add the `--generate_onboarding` argument to the Python script final
@@ -686,10 +721,15 @@ The output will look similar to the following one:
686721
### Creating a factory data partition with the second script
687722
688723
To store the factory data set in the device's persistent storage, convert the
689-
data from the JSON file to its binary representation in the CBOR format. To do
690-
this, use the
724+
data from the JSON file to its binary representation in the CBOR format. This is
725+
done by the
726+
[generate_nrfconnect_chip_factory_data.py](../../scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py),
727+
if you provide optional `offset` and `size` arguments. If you provided these
728+
arguments, skip the following steps of this section.
729+
730+
You can skip these optional arguments and do this, using the
691731
[nrfconnect_generate_partition.py](../../scripts/tools/nrfconnect/nrfconnect_generate_partition.py)
692-
to generate the factory data partition:
732+
script, but this is obsolete solution kept only for backward compatibility:
693733
694734
1. Navigate to the _connectedhomeip_ root directory
695735
2. Run the following command pattern:
@@ -924,14 +964,13 @@ $ west flash
924964
## Using own factory data implementation
925965
926966
The [factory data generation process](#generating-factory-data) described above
927-
is only an example valid for the nRF Connect platform. You can also create a HEX
928-
file containing all components from the
929-
[factory data component table](#factory-data-component-table) in any format and
930-
then implement a parser to read out all parameters and pass them to a provider.
931-
Each manufacturer can implement a factory data set on its own by implementing a
932-
parser and a factory data accessor inside the Matter stack. Use the
933-
[nRF Connect Provider](../../src/platform/nrfconnect/FactoryDataProvider.h) and
934-
[FactoryDataParser](../../src/platform/nrfconnect/FactoryDataParser.h) as
967+
is only an example valid for the nRF Connect platform. You can well create a HEX
968+
file containing all [factory data components](#factory-data-component-table) in
969+
any format and then implement a parser to read out all parameters and pass them
970+
to a provider. Each manufacturer can implement a factory data set on its own by
971+
implementing a parser and a factory data accessor inside the Matter stack. Use
972+
the [nRF Connect Provider](../../src/platform/nrfconnect/FactoryDataProvider.h)
973+
and [FactoryDataParser](../../src/platform/nrfconnect/FactoryDataParser.h) as
935974
examples.
936975
937976
You can read the factory data set from the device's flash memory in different

0 commit comments

Comments
 (0)