@@ -37,7 +37,7 @@ data secure by applying hardware write protection.
37
37
- [ Appearance field description] ( #appearance-field-description )
38
38
- [ Enabling factory data support] ( #enabling-factory-data-support )
39
39
- [ Generating factory data] ( #generating-factory-data )
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 )
40
+ - [ Creating the factory data JSON file with the first script] ( #creating-the-factory-data-json-file -with-the-first-script )
41
41
- [ How to set user data] ( #how-to-set-user-data )
42
42
- [ How to handle user data] ( #how-to-handle-user-data )
43
43
- [ Verifying using the JSON Schema tool] ( #verifying-using-the-json-schema-tool )
@@ -218,19 +218,14 @@ file written in another way. To make sure that the JSON file is correct and the
218
218
device is able to read out parameters,
219
219
[ verify the file using the JSON schema tool] ( #verifying-using-the-json-schema-tool ) .
220
220
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
221
+ ### Creating the factory data JSON file with the first script
227
222
228
223
A Matter device needs a proper factory data partition stored in the flash memory
229
224
to read out all required parameters during startup. To simplify the factory data
230
225
generation, you can use the
231
226
[ generate_nrfconnect_chip_factory_data.py] ( ../../scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py )
232
227
Python script to provide all required parameters and generate a human-readable
233
- JSON file and save it to a HEX file .
228
+ JSON file.
234
229
235
230
To use this script, complete the following steps:
236
231
@@ -250,10 +245,10 @@ To use this script, complete the following steps:
250
245
--sn --vendor_id, --product_id, --vendor_name, --product_name, --date, --hw_ver, --hw_ver_str, --spake2_it, --spake2_salt, --discriminator
251
246
```
252
247
253
- b. Add output path to store .json file, e.g. my_dir/output :
248
+ b. Add output file path :
254
249
255
250
```
256
- -o <path_to_output_file >
251
+ -o <path_to_output_json_file >
257
252
```
258
253
259
254
c. Generate SPAKE2 verifier using one of the following methods:
@@ -346,34 +341,6 @@ To use this script, complete the following steps:
346
341
> `chip-cert` executable. See the note at the end of this section to learn
347
342
> how to get it.
348
343
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
-
377
344
4. Run the script using the prepared list of arguments:
378
345
379
346
```
@@ -403,10 +370,8 @@ $ python scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py \
403
370
--passcode 20202021 \
404
371
--product_finish "matte" \
405
372
--product_color "black" \
406
- --out "build" \
407
- --schema "scripts/tools/nrfconnect/nrfconnect_factory_data.schema" \
408
- --offset 0xf7000 \
409
- --size 0x1000
373
+ --out "build.json" \
374
+ --schema "scripts/tools/nrfconnect/nrfconnect_factory_data.schema"
410
375
```
411
376
412
377
As the result of the above example, a unique ID for the rotating device ID is
@@ -605,7 +570,7 @@ To generate a manual pairing code and a QR code, complete the following steps:
605
570
```
606
571
607
572
2. Complete steps 1, 2, and 3 from the
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)
573
+ [Creating the factory data JSON file with the first script](#creating-the-factory-data-json-file -with-the-first-script)
609
574
section to prepare the final invocation of the Python script.
610
575
611
576
3. Add the `--generate_onboarding` argument to the Python script final
@@ -721,15 +686,10 @@ The output will look similar to the following one:
721
686
### Creating a factory data partition with the second script
722
687
723
688
To store the factory data set in the device's persistent storage, convert 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
689
+ data from the JSON file to its binary representation in the CBOR format. To do
690
+ this, use the
731
691
[nrfconnect_generate_partition.py](../../scripts/tools/nrfconnect/nrfconnect_generate_partition.py)
732
- script, but this is obsolete solution kept only for backward compatibility :
692
+ to generate the factory data partition :
733
693
734
694
1. Navigate to the _connectedhomeip_ root directory
735
695
2. Run the following command pattern:
@@ -964,13 +924,14 @@ $ west flash
964
924
## Using own factory data implementation
965
925
966
926
The [factory data generation process](#generating-factory-data) described above
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
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
974
935
examples.
975
936
976
937
You can read the factory data set from the device's flash memory in different
0 commit comments