My device uses the nRF52840. I migrated my Zigbee application from nRF Connect SDK v2.5.1 to the Zigbee R23 add-on v1.4.0.
After migrating to the R23 add-on, I noticed that once the device has successfully joined the Zigbee network, the CPU wakes up frequently—approximately once every second. It only wakes up briefly; this wake-up is not caused by the radio being enabled to poll for data.
My application works normally with nRF Connect SDK v2.5.1, and I did not observe this behavior with that version.
What could be causing this periodic CPU wake-up in the Zigbee R23 add-on v1.4.0? Could it be caused by an incorrect configuration option?
I have attached my prj.conf, ZigbeeStart function for reference.
# # Copyright (c) 2020 Nordic Semiconductor ASA # # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # #CONFIG_NCS_SAMPLES_DEFAULTS=y #CONFIG_UART_INTERRUPT_DRIVEN=y CONFIG_SERIAL=n CONFIG_GPIO=y # Make sure printk is not printing to the UART console CONFIG_CONSOLE=n CONFIG_UART_CONSOLE=n CONFIG_LOG=n CONFIG_HEAP_MEM_POOL_SIZE=2048 CONFIG_ZIGBEE_ADD_ON=y CONFIG_ZIGBEE_APP_UTILS=y CONFIG_ZIGBEE_ROLE_END_DEVICE=y CONFIG_ZIGBEE_CHANNEL_SELECTION_MODE_MULTI=y CONFIG_ZIGBEE_APP_CB_QUEUE_LENGTH=17 # Enable DK LED and Buttons library CONFIG_DK_LIBRARY=y CONFIG_PM_DEVICE=y # This example requires more workqueue stack CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 # Enable API for powering down unused RAM parts CONFIG_RAM_POWER_DOWN_LIBRARY=y ####################### # Zigbee FOTA overlay # ####################### # Enable Zigbee FOTA library CONFIG_ZIGBEE_FOTA=y CONFIG_ZIGBEE_FOTA_HW_VERSION=52 CONFIG_ZIGBEE_FOTA_ENDPOINT=5 CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="1.4.0" CONFIG_ZIGBEE_FOTA_COMMENT="Door sensor" CONFIG_ZIGBEE_FOTA_DOWNLOAD_RESUME=y # Ensure an MCUboot-compatible binary is generated. CONFIG_IMG_MANAGER=y CONFIG_STREAM_FLASH=y CONFIG_DFU_TARGET_MCUBOOT=y CONFIG_IMG_ERASE_PROGRESSIVELY=y CONFIG_ZIGBEE_FOTA_PROGRESS_EVT=y # Increase the number of RX buffers CONFIG_NRF_802154_RX_BUFFERS=32 CONFIG_ADC=y #CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y #debug #CONFIG_LOG=y #CONFIG_CONSOLE=y #CONFIG_USE_SEGGER_RTT=y #CONFIG_RTT_CONSOLE=y #CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=16384 #CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN=256
int ZigbeeStart(void)
{
LOG_INF("Starting Zigbee R23");
configure_gpio();
int err;
err= adc_init_now();
register_factory_reset_button(BUTTON_0);
//alarm_timers_init();
zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);
zb_set_ed_timeout (ED_AGING_TIMEOUT_1024MIN);
zb_set_keepalive_timeout (ZB_MILLISECONDS_TO_BEACON_INTERVAL(60*60*1000));
// send things to endpoint 1 on the coordinator
dest_ctx.short_addr = DEST_SHORT_ADDR;
dest_ctx.endpoint = DEST_ENDPOINT;
// configure for lowest power
zigbee_configure_sleepy_behavior (true);
power_down_unused_ram ();
#if defined(CONFIG_ZIGBEE_FOTA) || defined(CONFIG_ZIGBEE_BT_DFU)
/* Mark the current firmware as valid. */
confirm_image();
#endif
#ifdef CONFIG_ZIGBEE_FOTA
/* Initialize Zigbee FOTA download service. */
zigbee_fota_init(ota_evt_handler);
/* Register callback for handling ZCL commands. */
ZB_ZCL_REGISTER_DEVICE_CB(zcl_device_cb);
#endif /* CONFIG_ZIGBEE_FOTA */
#ifdef CONFIG_ZIGBEE_BT_DFU
zigbee_bt_dfu_init();
#endif
/* Register dimmer switch device context (endpoints). */
ZB_AF_REGISTER_DEVICE_CTX(&four_input_ctx);
app_clusters_attr_init();
/* Register handlers to identify notifications */
ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER(SOURCE_ENDPOINT, identify_cb);
#ifdef CONFIG_ZIGBEE_FOTA
ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER(CONFIG_ZIGBEE_FOTA_ENDPOINT, identify_cb);
#endif /* CONFIG_ZIGBEE_FOTA */
#if defined(CONFIG_LIGHT_SWITCH_CONFIGURE_TX_POWER)
set_tx_power();
#endif /* CONFIG_LIGHT_SWITCH_CONFIGURE_TX_POWER */
k_timer_init (&read_battery_voltage_timer, read_battery_voltage_cb, NULL);
k_timer_init (&read_door_timer, read_door_cb, NULL);
k_timer_init (&read_door_again_timer, read_door_again_cb, NULL);
/* Start Zigbee default thread. */
zigbee_enable();
LOG_INF("Door sensor R23 started");
while (1) {
k_sleep(K_FOREVER);
}
return 0;
}
