Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telink] Allow to erase entire NVS on factory reset by default; Fix IDM-7.1 test. (Cherry-pick #23434 & #23676) #23677

Conversation

s07641069
Copy link
Contributor

Problem

Commissioning Failed After Opening Multiple Commissioning Windows

Cherrypick partly #23434
Cherrypick #23676

Change overview

Allow to erase entire NVS on factory reset by default for Telink platform

Testing

Tested manually with chip-tool.
Steps:

Use chip-tool to perform commissioning with operational dataset in Terminal 1 and ensure our Matter device joins the network.
./chip-tool pairing ble-thread 1 hex:${DATASET} ${PIN_CODE}

In Terminal 1, use the following command to open a new ECM commissioning window:
./chip-tool pairing open-commissioning-window 1 1 400 2000 2001
This command will also generate and print out a manual pairing code (16384853021). The code will be used in the next step.

Open a new terminal 2. Perform commissioning and then open a new ECM Commissioning Window 2:
./chip-tool pairing code 2 16384853021 --commissioner-name beta
./chip-tool pairing open-commissioning-window 2 1 400 2000 2001 --commissioner-name beta
It will generate a new manual pairing code (16260155555).

Open a new terminal 3. Perform commissioning and then open a new ECM Commissioning Window 3:
./chip-tool pairing code 3 16260155555 --commissioner-name gamma
./chip-tool pairing open-commissioning-window 3 1 400 2000 2001 --commissioner-name gamma
A new manual pairing code (15433908150).

Open a new terminal 4. Perform commissioning and then open a new ECM Commissioning Window 4:
./chip-tool pairing code 4 15433908150 --commissioner-name 4
./chip-tool pairing open-commissioning-window 4 1 400 2000 2001 --commissioner-name 4
A new manual pairing code (16322914702).

Open a new terminal 5. Perform commissioning and then open a new ECM Commissioning Window 5:
./chip-tool pairing code 5 16322914702 --commissioner-name 5
./chip-tool pairing open-commissioning-window 5 1 400 2000 2001 --commissioner-name 5

After opening 5 ECM commissioning windows, just press the key 1 to perform factory reset.

Open a new terminal 6. Use chip-tool to perform commissioning with operational dataset in the new terminal.
./chip-tool pairing ble-thread 2 hex:${DATASET} ${PIN_CODE} 2001

* [Zephyr] Allow to erase entire NVS on factory reset

Currently, the default factory reset implementation simply
removes Matter (and OpenThread) settings instead of
formatting the non-volatile storage partition. The latter
approach may be advisable in the cases where no settings
need to survive a factory reset, as it is expected to work
properly regardless of the state of the storage partition.
Additionally, it will regain the original storage
performance if it has been loaded with a lot of stale data.

Signed-off-by: Damian Krolik <[email protected]>
@s07641069
Copy link
Contributor Author

@andy31415 could you review?

@andy31415 andy31415 merged commit 1d62999 into project-chip:v1.0-branch Nov 24, 2022
@s07641069 s07641069 deleted the telink_erase_entire_NVS_FR_cherry-pick branch November 25, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants