How to Restore Matter Subscription session After Reboot?

Hello, Nordic Team!

I am encountering a such problem when using the NRF54L15 on NCS3.0.2 to develop a Matter product. I am trying to use the 

SubscribeAttribute


method in ReadInteraction.h  to subscribe the status of a remote device. However, when my product reboots for some reason, the subscription is lost, and  I don't know how to restore it.

Additionally, I noticed that after commissioning to the Apple Homepod, my products reboots about 1 to 3 minutes, and I tried to print the reboot reason using the following code:

BootReasonType bootReason = BootReasonType::kUnspecified;
CHIP_ERROR error = DeviceLayer::GetDiagnosticDataProvider().GetBootReason(bootReason);

And I got

BootReasonType::kHardwareWatchdogReset

However, the watchdog timeout is set to 10 minutes. So, what could be the true reason for the reboot?

Here is my prj.conf.

#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# Enable CHIP
CONFIG_CHIP=y
CONFIG_CHIP_PROJECT_CONFIG="src/chip_project_config.h"
# 32772 == 0x8004 (example light-switch-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32772
CONFIG_STD_CPP17=y

# Enable Matter pairing automatically on application start.
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y

# Enable Matter extended announcement and increase duration to 1 hour.
CONFIG_CHIP_BLE_EXT_ADVERTISING=y
CONFIG_CHIP_BLE_ADVERTISING_DURATION=60

# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=n

# Bluetooth Low Energy configuration
CONFIG_BT_DEVICE_NAME="XXXX"

# Suspend devices when the CPU goes into sleep
CONFIG_PM_DEVICE=y
#ONFIG_PM_DEVICE_RUNTIME=y

# Other settings
CONFIG_THREAD_NAME=y
CONFIG_MPU_STACK_GUARD=y
CONFIG_RESET_ON_FATAL_ERROR=n

# Reduce application size
CONFIG_USE_SEGGER_RTT=n

# Enable Factory Data feature
CONFIG_CHIP_FACTORY_DATA=y
CONFIG_CHIP_FACTORY_DATA_BUILD=y

CONFIG_MAIN_STACK_SIZE=8192
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_CHIP_TASK_STACK_SIZE=10240
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096

CONFIG_BT_RX_STACK_SIZE=2600
CONFIG_IEEE802154_NRF5_RX_STACK_SIZE=512
CONFIG_OPENTHREAD_THREAD_STACK_SIZE=6144
CONFIG_OPENTHREAD_RADIO_WORKQUEUE_STACK_SIZE=1024
CONFIG_MPSL_WORK_STACK_SIZE=2048
CONFIG_MCUMGR_TRANSPORT_WORKQUEUE_STACK_SIZE=512

CONFIG_CHIP_DFU_OVER_BT_SMP=y

CONFIG_CHIP_QSPI_NOR=n
CONFIG_CHIP_SPI_NOR=n

CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y

# Enable Matter read client
CONFIG_CHIP_ENABLE_READ_CLIENT=y
CONFIG_CHIP_MAX_ACTIVE_DEVICES=10
CONFIG_CHIP_MAX_ACTIVE_CASE_CLIENTS=10
CONFIG_ZMS=y
CONFIG_SETTINGS_ZMS=y

# Matter shell commands
CONFIG_CHIP_LIB_SHELL=n
CONFIG_NCS_SAMPLE_MATTER_TEST_SHELL=n
CONFIG_CHIP_MEMORY_PROFILING=n
CONFIG_CHIP_STATISTICS=n
CONFIG_SHELL=n
CONFIG_KERNEL_SHELL=n
CONFIG_SHELL_VT100_COLORS=n
#CONFIG_SHELL_STACK_SIZE=2048

CONFIG_PWM=y
CONFIG_GPIO=y
CONFIG_ADC=y

CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS=y

There is also another issue related to the reboot. When first commissioned to the Apple Homepod, my product receives the UTC time. However  after a reboot or a brief power loss. The connection state is restored but the UTC time is lost. Can I get the UTC immediately after a reboot? Is there a way to obtain the UTC time, perhaps via SNTP? Is this method feasible?

Thanks!
Xiongwei.Wang

Related