CC2340R5: What is the cause of ZB_NLME_STATUS_INDICATION?

Part Number: CC2340R5

 

      case ZB_NLME_STATUS_INDICATION:
      {
        zb_zdo_signal_nlme_status_indication_params_t *nlme_status_ind = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_zdo_signal_nlme_status_indication_params_t);
        printf("Network operation %02x,nwk_addr = %02x\r\n", nlme_status_ind->nlme_status.status,nlme_status_ind->nlme_status.network_addr);
        break;
      }

Where can I find the meaning of the status bits represented by nlme_status_ind->nlme_status.status and nlme_status_ind->nlme_status.network_addr? Under what circumstances will this signal occur? Why will the coordinator restart after generating this signal multiple times?

  • Hello bin,

    The zb_zdo_signal_nlme_status_indication_params_t is a struct for zb_nlme_status_indication_t which contains the status (error code associated with the failure) and network_addr (network device address associated with the status information).  You can consult <sdk_install_directory>\source\third_party\zigbee\zboss_r23\include\zboss_api_nwk.h for the list of available ZB_NWK_COMMAND_STATUS_* definitions.

    Regards,
    Ryan

  • /** @cond internals_doc */
    /**
     * @name Network command status codes
     * @anchor nwk_command_status
     */
    /** @{ */
    #define ZB_NWK_COMMAND_STATUS_NO_ROUTE_AVAILABLE          0x00U /**< No route available */
    #define ZB_NWK_COMMAND_STATUS_TREE_LINK_FAILURE           0x01U /**< Tree link failure */
    #define ZB_NWK_COMMAND_STATUS_NONE_TREE_LINK_FAILURE      0x02U /**< None-tree link failure */
    #define ZB_NWK_COMMAND_STATUS_LOW_BATTERY_LEVEL           0x03U /**< Low battery level */
    #define ZB_NWK_COMMAND_STATUS_NO_ROUTING_CAPACITY         0x04U /**< No routing capacity */
    #define ZB_NWK_COMMAND_STATUS_NO_INDIRECT_CAPACITY        0x05U /**< No indirect capacity */
    #define ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY 0x06U /**< Indirect transaction expiry */
    #define ZB_NWK_COMMAND_STATUS_TARGET_DEVICE_UNAVAILABLE   0x07U /**< Target device unavailable */
    #define ZB_NWK_COMMAND_STATUS_TARGET_ADDRESS_UNALLOCATED  0x08U /**< Target address unallocated */
    #define ZB_NWK_COMMAND_STATUS_PARENT_LINK_FAILURE         0x09U /**< Parent link failure */
    #define ZB_NWK_COMMAND_STATUS_VALIDATE_ROUTE              0x0aU /**< Validate route */
    #define ZB_NWK_COMMAND_STATUS_SOURCE_ROUTE_FAILURE        0x0bU /**< Source route failure */
    #define ZB_NWK_COMMAND_STATUS_MANY_TO_ONE_ROUTE_FAILURE   0x0cU /**< Many-to-one route failure */
    #define ZB_NWK_COMMAND_STATUS_ADDRESS_CONFLICT            0x0dU /**< Address conflict */
    #define ZB_NWK_COMMAND_STATUS_VERIFY_ADDRESS              0x0eU /**< Verify address */
    #define ZB_NWK_COMMAND_STATUS_PAN_IDENTIFIER_UPDATE       0x0fU /**< Pan ID update */
    #define ZB_NWK_COMMAND_STATUS_NETWORK_ADDRESS_UPDATE      0x10U /**< Network address update */
    #define ZB_NWK_COMMAND_STATUS_BAD_FRAME_COUNTER           0x11U /**< Bad frame counter  */
    #define ZB_NWK_COMMAND_STATUS_BAD_KEY_SEQUENCE_NUMBER     0x12U /**< Bad key sequence number */
    #define ZB_NWK_COMMAND_STATUS_UNKNOWN_COMMAND             0x13U /**< Command received is not known *//** @} */
    /** @} */

    Cortex_M0P: Network operation 19,nwk_addr = 481

    Cortex_M0P: Network operation 19,nwk_addr = 481

    Cortex_M0P: Network operation 19,nwk_addr = 481
    The output is 0x19, but I haven't seen the corresponding error status value.
  • I cannot find any 0x19 error codes, I suspect based on this information and your other E2E thread that the application signal is not being processed correctly.  This could also explain your device resets. Please review my comments and consider doing a diff compare between the working F3 SDK v9.14 examples and your erroneous application file to discover any missing elements which could explain this odd behavior.

    Regards,
    Ryan

  • How should this signal be handled? After it is generated multiple times, the device will restart. What is the reason for generating this signal?

    #define ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY 0x06U /**< Indirect transaction expiry */

  • ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY will be returned for MAC_TRANSACTION_OVERFLOW or MAC_TRANSACTION_EXPIRED.  This insinuates an issue with either the transmit buffers or a sleepy end node not reporting in time to receive a message before it is timed out on the local parent device.  In either case it is paramount that you adequately manage your application buffers as failing to do so could plausibly cause a device software reset.

    Regards,
    Ryan

  • How to check the size of the application buffer and the related settings, and determine how many terminals the coordinator can receive and how large the data packets sent by the terminals can be at the same time.

  • I believe most of your questions are addressed by the Zigbee stack RAM usage configuration section of the ZBOSS User's Guide.  You can support larger buffer sizes and more joining devices with a CC27XX device which contains more RAM.

    Regards,
    Ryan

  • The coordinator only connects to one device. After the device leaves the network, it still shows ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY and ZB_NWK_COMMAND_STATUS_NO_ROUTE_AVAILABLE. Why is that?

    [10:21:48.527]收←◆long_addr : 05:48:3f:2f:00:4b:12:00
    
    [10:21:48.759]收←◆leave device short addr = 0x1fbb
    
    [10:21:56.429]收←◆Network operation 06,nwk_addr = 1fbb
    Network operation 06,nwk_addr = 1fbb
    
    [10:22:07.137]收←◆Network operation 00,nwk_addr = 1fbb
    
    [10:22:18.285]收←◆Network operation 00,nwk_addr = 1fbb
    
    [10:22:33.478]收←◆Network operation 00,nwk_addr = 1fbb
    

  • These are the expected responses from ZBOSS if the application is attempting to send messages to a device that has left the network and is unavailable.

    Regards,
    Ryan

  • Can this application buffer be cleared? I am using a coordinator to connect with 6 terminal devices. Each of the 6 terminal devices sends 48 bytes of data every 10 seconds. After running for 1 hour, when reconnecting again, the "ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY" error occurs. How should I operate to prevent this status from occurring every time I reconnect?

    [09:15:02.179]收←◆a55a30026916952501000000691695270100000069169529010000006916952b010000006916952d0100000000f40d0a 0f:48:3f:2f:00:4b:12:00
    
    [09:15:02.815]收←◆a55a300269169525090d000069169527090d000069169529090b00006916952b090b00006916952d090b000000f70d0a 05:48:3f:2f:00:4b:12:00
    
    [09:15:02.866]收←◆a55a30026916952501000000691695270100000069169529010000006916952b010000006916952d0100000000f40d0a 72:47:3f:2f:00:4b:12:00
    a55a30026916952501000000691695270100000069169529010000006916952b010000006916952d0100000000f40d0a 58:45:3f:2f:00:4b:12:00
    
    [09:15:02.941]收←◆a55a30026916952501000000691695270100000069169529010000006916952b010000006916952d0100000000f40d0a 5a:45:3f:2f:00:4b:12:00
    
    [09:15:03.106]收←◆a55a30026916952501000000691695270100000069169529010000006916952b010000006916952d0100000001f50d0a 59:45:3f:2f:00:4b:12:00
    
    [09:15:18.327]收←◆leave device short addr = 0xe009
    
    [09:15:18.571]收←◆leave device short addr = 0xaa9b
    
    [09:15:18.644]收←◆leave device short addr = 0xb57f
    
    [09:15:18.941]收←◆leave device short addr = 0xb023
    
    [09:15:19.052]收←◆leave device short addr = 0x9e1b
    
    [09:15:19.279]收←◆leave device short addr = 0x80b0
    
    [09:16:30.021]收←◆long_addr : 58:45:3f:2f:00:4b:12:00
    
    [09:16:35.914]收←◆long_addr : 72:47:3f:2f:00:4b:12:00
    
    [09:16:37.737]收←◆long_addr : 0f:48:3f:2f:00:4b:12:00
    
    [09:16:55.260]收←◆long_addr : 05:48:3f:2f:00:4b:12:00
    
    [09:18:22.152]收←◆long_addr : 59:45:3f:2f:00:4b:12:00
    leave device short addr = 0x0c7c
    
    [09:18:32.591]收←◆Network operation 00,nwk_addr = c7c
    
    [09:19:00.042]收←◆Network operation 00,nwk_addr = c7c
    
    [09:19:15.424]收←◆Network operation 00,nwk_addr = c7c
    
    [09:19:19.339]收←◆unavailable_short_addr = 0x0c7c
    
    [09:19:25.865]收←◆long_addr : 59:45:3f:2f:00:4b:12:00
    
    [09:19:25.942]收←◆leave device short addr = 0x0c7c
    
    [09:19:33.790]收←◆Network operation 06,nwk_addr = c7c
    Network operation 06,nwk_addr = c7c
    
    [09:19:44.513]收←◆Network operation 00,nwk_addr = c7c
    
    [09:19:58.960]收←◆Network operation 00,nwk_addr = c7c
    
    [09:20:13.194]收←◆Network operation 00,nwk_addr = c7c

  • Please refer to the Zigbee Fundamental Project Development SLA where it concerns send_aps_payload_cb.  This function will return the status of the application payload and then will free the buffer regardless.  An indirect transaction expiry could be explained by the ZED not sending a data request to its parent before the expiration time (see compile-time configuration parameters).  If you believe there is a bug within the ZBOSS stack then please send detailed instructions on how to replicate with Zigbee examples from the F3 SDK.

    Regards,
    Ryan

  • /******************************************************************************
     Group: CMCU LPRF
     Target Device: cc23xx
    
     ******************************************************************************
     
     Copyright (c) 2024-2025, Texas Instruments Incorporated
     All rights reserved.
    
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
    
     *  Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
    
     *  Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
    
     *  Neither the name of Texas Instruments Incorporated nor the names of
        its contributors may be used to endorse or promote products derived
        from this software without specific prior written permission.
    
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
     ******************************************************************************
     
     
     *****************************************************************************/
    
    /***** Trace related defines *****/
    #define ZB_TRACE_FILE_ID 40123
    
    /****** Application defines ******/
    #define ZB_OUTPUT_ENDPOINT          5
    #define ZB_OUTPUT_MAX_CMD_PAYLOAD_SIZE 2
    
    #include <ti/log/Log.h>
    
    #include "ti_zigbee_config.h"
    #include "zboss_api.h"
    #include "zb_led_button.h"
    #include "zboss_api_error.h"
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(inc/hw_fcfg.h)
    #include DeviceFamily_constructPath(inc/hw_memmap.h)
    
    /* for button handling */
    #include <ti/drivers/GPIO.h>
    #include "ti_drivers_config.h"
    
    #ifdef ZB_CONFIGURABLE_MEM
    #include "zb_mem_config_lprf3.h"
    #endif
    
    #include "stdio.h"
    
    /****** Application variables declarations ******/
    zb_uint16_t g_dst_addr;
    zb_uint8_t g_addr_mode;
    zb_uint8_t g_endpoint;
    zb_bool_t perform_factory_reset = ZB_FALSE;
    
    /****** Application function declarations ******/
    /* Handler for specific ZCL commands */
    zb_uint8_t zcl_specific_cluster_cmd_handler(zb_uint8_t param);
    void test_device_interface_cb(zb_uint8_t param);
    void button_press_handler(zb_uint8_t param);
    
    /****** Cluster declarations ******/
    /* On/Off cluster attributes */
    zb_uint8_t g_attr_on_off = ZB_ZCL_ON_OFF_ON_OFF_DEFAULT_VALUE;
    #ifdef ZB_ENABLE_ZLL
    /* On/Off cluster attributes additions */
    zb_bool_t g_attr_global_scene_ctrl  = ZB_TRUE;
    zb_uint16_t g_attr_on_time  = 0;
    zb_uint16_t g_attr_off_wait_time  = 0;
    
    ZB_ZCL_DECLARE_ON_OFF_ATTRIB_LIST_EXT(on_off_attr_list, &g_attr_on_off,
        &g_attr_global_scene_ctrl, &g_attr_on_time, &g_attr_off_wait_time);
    #else
    ZB_ZCL_DECLARE_ON_OFF_ATTRIB_LIST(on_off_attr_list, &g_attr_on_off);
    #endif
    
    /* Basic cluster attributes */
    zb_uint8_t g_attr_zcl_version  = ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE;
    zb_uint8_t g_attr_power_source = ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE;
    
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST(basic_attr_list, &g_attr_zcl_version, &g_attr_power_source);
    
    /* Identify cluster attributes */
    zb_uint16_t g_attr_identify_time = ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE;
    
    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &g_attr_identify_time);
    
    /* Groups cluster attributes */
    zb_uint8_t g_attr_name_support = 0;
    
    ZB_ZCL_DECLARE_GROUPS_ATTRIB_LIST(groups_attr_list, &g_attr_name_support);
    
    #ifdef ZB_ZCL_SUPPORT_CLUSTER_SCENES
    /* Scenes cluster attributes */
    zb_uint8_t g_attr_scenes_scene_count = ZB_ZCL_SCENES_SCENE_COUNT_DEFAULT_VALUE;
    zb_uint8_t g_attr_scenes_current_scene = ZB_ZCL_SCENES_CURRENT_SCENE_DEFAULT_VALUE;
    zb_uint16_t g_attr_scenes_current_group = ZB_ZCL_SCENES_CURRENT_GROUP_DEFAULT_VALUE;
    zb_uint8_t g_attr_scenes_scene_valid = ZB_ZCL_SCENES_SCENE_VALID_DEFAULT_VALUE;
    zb_uint16_t g_attr_scenes_name_support = ZB_ZCL_SCENES_NAME_SUPPORT_DEFAULT_VALUE;
    
    ZB_ZCL_DECLARE_SCENES_ATTRIB_LIST(scenes_attr_list, &g_attr_scenes_scene_count,
        &g_attr_scenes_current_scene, &g_attr_scenes_current_group,
        &g_attr_scenes_scene_valid, &g_attr_scenes_name_support);
    #else
    zb_zcl_attr_t scenes_attr_list[] = { ZB_ZCL_NULL_ID, 0, 0, NULL };
    #endif
    
    /* Declare cluster list for the device */
    ZB_HA_DECLARE_ON_OFF_OUTPUT_CLUSTER_LIST(on_off_output_clusters,
                                             on_off_attr_list,
                                             basic_attr_list,
                                             identify_attr_list,
                                             groups_attr_list,
                                             scenes_attr_list);
    
    /* Declare endpoint */
    ZB_HA_DECLARE_ON_OFF_OUTPUT_EP(on_off_output_ep, ZB_OUTPUT_ENDPOINT, on_off_output_clusters);
    
    /* Declare application's device context for single-endpoint device */
    ZB_HA_DECLARE_ON_OFF_OUTPUT_CTX(on_off_output_ctx, on_off_output_ep);
    
    
    static zb_bool_t error_ind_handler(zb_uint8_t severity,
                                       zb_ret_t error_code,
                                       void *additional_info);
    
    void off_network_attention(zb_uint8_t param)
    {
      ZVUNUSED(param);
      Log_printf(LogModule_Zigbee_App, Log_INFO, "off_network_attention");
      zb_osif_led_toggle(1);
    
      ZB_SCHEDULE_APP_ALARM(off_network_attention, 0, 1 * ZB_TIME_ONE_SECOND);
    }
    
    MAIN()
    {
      ARGV_UNUSED;
    
      /* Global ZBOSS initialization */
      ZB_INIT("on_off_light");
    
      #ifdef ZB_LONG_ADDR
      // use the address that the customer set in the pre-defined symbols tab
      zb_ieee_addr_t g_long_addr = ZB_LONG_ADDR;
      zb_set_long_address(g_long_addr);
      #else
      /* Set the device's long address to the IEEE address pulling from the FCFG of the device */
      zb_ieee_addr_t ieee_mac_addr;
      ZB_MEMCPY(ieee_mac_addr, fcfg->deviceInfo.macAddr, 8);
      zb_set_long_address(ieee_mac_addr);
      #endif // ZB_LONG_ADDR
    
    #ifdef ZB_COORDINATOR_ROLE
      /* Set up defaults for the commissioning */
      zb_set_network_coordinator_role(DEFAULT_CHANLIST);
    
      /* Set keepalive mode to mac data poll so sleepy zeds consume less power */
      zb_set_keepalive_mode(MAC_DATA_POLL_KEEPALIVE);
    #ifdef DEFAULT_NWK_KEY
      zb_uint8_t nwk_key[16] = DEFAULT_NWK_KEY;
      zb_secur_setup_nwk_key(nwk_key, 0);
    #endif //DEFAULT_NWK_KEY
    
    #ifdef ZBOSS_REV23
      zb_nwk_set_max_ed_capacity(MAX_ED_CAPACITY);
    #endif //ZBOSS_REV23
    
    #elif defined ZB_ROUTER_ROLE && !defined ZB_COORDINATOR_ROLE
      zb_set_network_router_role(DEFAULT_CHANLIST);
    
    #ifdef ZBOSS_REV23
      zb_nwk_set_max_ed_capacity(MAX_ED_CAPACITY);
    #endif //ZBOSS_REV23
    
      /* Set keepalive mode to mac data poll so sleepy zeds consume less power */
      zb_set_keepalive_mode(MAC_DATA_POLL_KEEPALIVE);
    
    #elif defined ZB_ED_ROLE
      zb_set_network_ed_role(DEFAULT_CHANLIST);
    
      /* Set end-device configuration parameters */
      zb_set_ed_timeout(ED_TIMEOUT_VALUE);
      zb_set_rx_on_when_idle(ED_RX_ALWAYS_ON);
    #if ( ED_RX_ALWAYS_ON == ZB_FALSE )
      zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(ED_POLL_RATE));
      zb_zdo_pim_set_long_poll_interval(ED_POLL_RATE);
    #ifdef DISABLE_TURBO_POLL
      // Disable turbo poll feature
      zb_zdo_pim_permit_turbo_poll(ZB_FALSE);
    #endif // DISABLE_TURBO_POLL
    #endif //ED_RX_ALWAYS_ON
    #endif //ZB_ED_ROLE
    
      zb_set_nvram_erase_at_start(ZB_FALSE);
    
    #ifdef ZB_ENABLE_PTA
      zb_enable_pta(0);
    #endif
    
     /* Register device ZCL context */
      ZB_AF_REGISTER_DEVICE_CTX(&on_off_output_ctx);
    
      /* Register cluster commands handler for a specific endpoint */
      ZB_AF_SET_ENDPOINT_HANDLER(ZB_OUTPUT_ENDPOINT, zcl_specific_cluster_cmd_handler);
    
      /* Set Device user application callback */
      ZB_ZCL_REGISTER_DEVICE_CB(test_device_interface_cb);
    
      zb_error_register_app_handler(error_ind_handler);
    
      /* Initiate the stack start without starting the commissioning */
      if (zboss_start_no_autostart() != RET_OK)
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "zboss_start failed");
      }
      else
      {
        GPIO_setConfig(CONFIG_GPIO_BTN1, GPIO_CFG_IN_PU);
        GPIO_setConfig(CONFIG_GPIO_BTN2, GPIO_CFG_IN_PU);
        // if either button 1 or button 2 gets pressed
        zb_bool_t sideButtonPressed = ((GPIO_read((zb_uint8_t)CONFIG_GPIO_BTN1) == 0U) || (GPIO_read((zb_uint8_t)CONFIG_GPIO_BTN2) == 0U));
        // then perform a factory reset
        if (sideButtonPressed)
        {
          perform_factory_reset = ZB_TRUE;
          Log_printf(LogModule_Zigbee_App, Log_INFO, "performing factory reset");
        }
    
        zb_osif_led_button_init();
    #ifndef ZB_COORDINATOR_ROLE
        ZB_SCHEDULE_APP_ALARM(off_network_attention, 0, 1 * ZB_TIME_ONE_SECOND);
    #endif /* ZB_COORDINATOR_ROLE */
    
        /* Call the main loop */
        zboss_main_loop();
      }
    
      MAIN_RETURN(0);
    }
    
    
    static zb_bool_t error_ind_handler(zb_uint8_t severity,
                                        zb_ret_t error_code,
                                        void *additional_info)
    {
      zb_bool_t ret = ZB_FALSE;
      ZVUNUSED(additional_info);
      /* Unused without trace. */
      ZVUNUSED(severity);
    
      Log_printf(LogModule_Zigbee_App, Log_ERROR, "error_ind_handler severity %d error_code %d", severity, error_code);
    
      if (error_code == ERROR_CODE(ERROR_CATEGORY_MACSPLIT, ZB_ERROR_MACSPLIT_RADIO_HANG))
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "Fatal macsplit error");
    
        ret = ZB_TRUE;
        /* return TRUE to prevent default error handling by the stack */
      }
      if (error_code == ERROR_CODE(ERROR_CATEGORY_MACSPLIT, ZB_ERROR_MACSPLIT_RADIO_REBOOT))
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "macsplit radio reboot");
    
        ret = ZB_TRUE;
      }
      Log_printf(LogModule_Zigbee_App, Log_ERROR, "error_ind_handler ret %d", ret);
      return ret;
    }
    
    
    void test_device_interface_cb(zb_uint8_t param)
    {
      zb_zcl_device_callback_param_t *device_cb_param =
        ZB_BUF_GET_PARAM(param, zb_zcl_device_callback_param_t);
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "> test_device_interface_cb param %d id 0x%x",
                 param, device_cb_param->device_cb_id);
    
      device_cb_param->status = RET_OK;
    
      switch (device_cb_param->device_cb_id)
      {
        case ZB_ZCL_SET_ATTR_VALUE_CB_ID:
          if (device_cb_param->cb_param.set_attr_value_param.cluster_id == ZB_ZCL_CLUSTER_ID_ON_OFF &&
              device_cb_param->cb_param.set_attr_value_param.attr_id == ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID)
          {
            if (device_cb_param->cb_param.set_attr_value_param.values.data8)
            {
              Log_printf(LogModule_Zigbee_App, Log_INFO, "set ON");
    #ifdef ZB_USE_BUTTONS
              zb_osif_led_on(0);
    #endif
            }
            else
            {
              Log_printf(LogModule_Zigbee_App, Log_INFO, "set OFF");
    #ifdef ZB_USE_BUTTONS
              zb_osif_led_off(0);
    #endif
            }
          }
          else if (device_cb_param->cb_param.set_attr_value_param.cluster_id == ZB_ZCL_CLUSTER_ID_IDENTIFY &&
                   device_cb_param->cb_param.set_attr_value_param.attr_id == ZB_ZCL_ATTR_IDENTIFY_IDENTIFY_TIME_ID)
          {
            Log_printf(LogModule_Zigbee_App, Log_INFO, "identify time changed to %d (0x%x)",
                       device_cb_param->cb_param.set_attr_value_param.values.data16, device_cb_param->cb_param.set_attr_value_param.values.data16);
          }
          else
          {
            /* MISRA rule 15.7 requires empty 'else' branch. */
          }
          break;
    
        default:
          device_cb_param->status = RET_ERROR;
          break;
      }
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "< test_device_interface_cb %d", device_cb_param->status);
    }
    
    static void handle_diag_data_resp(zb_bufid_t buf)
    {
      zb_zdo_get_diag_data_resp_params_t *resp_params;
    
      resp_params = ZB_BUF_GET_PARAM(buf, zb_zdo_get_diag_data_resp_params_t);
    
      ZVUNUSED(resp_params);
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "handle_diag_data_resp, status: %d, addr: 0x%x, lqi: %d, rssi: %d",
                 resp_params->status, resp_params->short_address,
                 resp_params->lqi, resp_params->rssi);
    
      zb_buf_free(buf);
    }
    
    static void send_diag_data_req(zb_uint16_t short_address)
    {
      zb_zdo_get_diag_data_req_params_t *req;
      zb_bufid_t buf;
    
      buf = zb_buf_get_out();
      if (buf != ZB_BUF_INVALID)
      {
        req = ZB_BUF_GET_PARAM(buf, zb_zdo_get_diag_data_req_params_t);
        ZB_BZERO(req, sizeof(*req));
    
        req->short_address = short_address;
        zb_zdo_get_diag_data_async(buf, handle_diag_data_resp);
      }
      else
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "Failed to get a buffer");
      }
    }
    
    zb_uint8_t zcl_specific_cluster_cmd_handler(zb_uint8_t param)
    {
      zb_zcl_parsed_hdr_t cmd_info;
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "> zcl_specific_cluster_cmd_handler");
    
      ZB_ZCL_COPY_PARSED_HEADER(param, &cmd_info);
    
      g_dst_addr = ZB_ZCL_PARSED_HDR_SHORT_DATA(&cmd_info).source.u.short_addr;
      g_endpoint = ZB_ZCL_PARSED_HDR_SHORT_DATA(&cmd_info).src_endpoint;
      g_addr_mode = ZB_APS_ADDR_MODE_16_ENDP_PRESENT;
    
      ZB_ZCL_DEBUG_DUMP_HEADER(&cmd_info);
      Log_printf(LogModule_Zigbee_App, Log_INFO, "payload size: %i", zb_buf_len(param));
    
      send_diag_data_req(g_dst_addr);
    
      if (cmd_info.cmd_direction == ZB_ZCL_FRAME_DIRECTION_TO_CLI)
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "Unsupported \"from server\" command direction");
      }
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "< zcl_specific_cluster_cmd_handler");
      return ZB_FALSE;
    }
    
    void restart_commissioning(zb_uint8_t param)
    {
      ZVUNUSED(param);
      bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING);
    }
    
    void button_press_handler(zb_uint8_t param)
    {
      ZVUNUSED(param);
      Log_printf(LogModule_Zigbee_App, Log_INFO, "button is pressed, do nothing");
    }
    
    void set_tx_power(zb_int8_t power)
    {
      zb_uint32_t chanlist = DEFAULT_CHANLIST;
      for (zb_uint8_t i = 0; i < 32; i++) {
        if (chanlist & (1U << i)) {
          zb_bufid_t buf = zb_buf_get_out();
          if (!buf)
          {
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "no buffer available");
            return;
          }
    
          zb_tx_power_params_t *power_params = (zb_tx_power_params_t *)zb_buf_begin(buf);
          power_params->status = RET_OK;
          power_params->page = 0;
          power_params->channel = i;
          power_params->tx_power = power;
          power_params->cb = NULL;
    
          zb_set_tx_power_async(buf);
        }
      }
    }
    
    /* Callback to handle the stack events */
    void zboss_signal_handler(zb_uint8_t param)
    {
        zb_zdo_app_signal_hdr_t *sg_p = NULL;
      zb_zdo_app_signal_type_t sig = zb_get_app_signal(param, &sg_p); // 需要注意的点
    
      if (ZB_GET_APP_SIGNAL_STATUS(param) == 0)
      {
        switch(sig)
        {
    #ifndef ZB_MACSPLIT_HOST
          case ZB_ZDO_SIGNAL_SKIP_STARTUP:
    #else
          case ZB_MACSPLIT_DEVICE_BOOT:
    #endif /* ZB_MACSPLIT_HOST */
    
    #ifdef TEST_USE_INSTALLCODE
            zb_secur_ic_str_add(g_ed_addr, g_installcode, NULL);
    #endif
            set_tx_power(DEFAULT_TX_PWR);
            zboss_start_continue();
            break;
    
          case ZB_BDB_SIGNAL_DEVICE_FIRST_START:
          case ZB_BDB_SIGNAL_DEVICE_REBOOT:
          {
            zb_nwk_device_type_t device_type = ZB_NWK_DEVICE_TYPE_NONE;
            device_type = zb_get_device_type();
            ZVUNUSED(device_type);
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Device (%d) STARTED OK", device_type);
            if (perform_factory_reset)
            {
              Log_printf(LogModule_Zigbee_App, Log_INFO, "Performing a factory reset.");
              zb_bdb_reset_via_local_action(0);
              perform_factory_reset = ZB_FALSE;
            }
            else if(ZB_BDB_SIGNAL_DEVICE_REBOOT == sig)
            {
              ZB_SCHEDULE_APP_ALARM_CANCEL(off_network_attention, ZB_ALARM_ANY_PARAM);
              zb_osif_led_off(1);
            }
            set_tx_power(DEFAULT_TX_PWR);
            bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING);
    
    #ifdef ZB_USE_BUTTONS
            zb_button_register_handler(0, 0, button_press_handler);
    #endif
            break;
          }
          case ZB_COMMON_SIGNAL_CAN_SLEEP:
          {
    #ifdef ZB_USE_SLEEP
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Sleeping now");
            zb_sleep_now();
    #endif
            break;
          }
          case ZB_BDB_SIGNAL_STEERING:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Successful steering, start f&b target");
            zb_bdb_finding_binding_target(ZB_OUTPUT_ENDPOINT);
            ZB_SCHEDULE_APP_ALARM_CANCEL(off_network_attention, ZB_ALARM_ANY_PARAM);
            zb_osif_led_off(1);
            break;
          case ZB_NLME_STATUS_INDICATION:
          {
            zb_zdo_signal_nlme_status_indication_params_t *nlme_status_ind = ZB_ZDO_SIGNAL_GET_PARAMS(sg_p, zb_zdo_signal_nlme_status_indication_params_t);
            printf("Network operation %02x,nwk_addr = %02x\r\n", nlme_status_ind->nlme_status.status,nlme_status_ind->nlme_status.network_addr);
            // zdo_leave_end_req(param,nlme_status_ind->nlme_status.network_addr);
            break;
          }
    
          default:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Unknown signal %d", (zb_uint16_t)sig);
            printf("Unknown signal %d\r\n", (zb_uint16_t)sig);
        }
      }
      else
      {
        switch(sig)
        {
          case ZB_BDB_SIGNAL_DEVICE_FIRST_START:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Device can not find any network on start, so try to perform network steering");
            ZB_SCHEDULE_APP_ALARM(restart_commissioning, 0, 10 * ZB_TIME_ONE_SECOND);
            break; /* ZB_BDB_SIGNAL_DEVICE_FIRST_START */
    
          case ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Production config is not present or invalid");
            break;
    
          case ZB_BDB_SIGNAL_STEERING:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Steering failed, retrying again in 10 seconds");
            ZB_SCHEDULE_APP_ALARM(restart_commissioning, 0, 10 * ZB_TIME_ONE_SECOND);
            break; /* ZB_BDB_SIGNAL_STEERING */
    
          default:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Device started FAILED status %d sig %d", ZB_GET_APP_SIGNAL_STATUS(param), sig);
        }
      }
    
      /* Free the buffer if it is not used */
      if (param)
      {
        zb_buf_free(param);
      }
    }
    

    This is the code I used for testing the onoff_light as the coordinator. I only added a print statement for the signal value. I still used onoff_switch as the terminal. The coordinator remained powered on, and after the terminal device was connected, it was reprogrammed. After multiple attempts, the ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY and ZB_NWK_COMMAND_STATUS_NO_ROUTE_AVAILABLE states still occurred. Why is this? The terminal did not make any modifications and did not specifically use send_aps_payload to send.

    /******************************************************************************
     Group: CMCU LPRF
     Target Device: cc23xx
    
     ******************************************************************************
     
     Copyright (c) 2024-2025, Texas Instruments Incorporated
     All rights reserved.
    
     Redistribution and use in source and binary forms, with or without
     modification, are permitted provided that the following conditions
     are met:
    
     *  Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
    
     *  Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
    
     *  Neither the name of Texas Instruments Incorporated nor the names of
        its contributors may be used to endorse or promote products derived
        from this software without specific prior written permission.
    
     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    
     ******************************************************************************
     
     
     *****************************************************************************/
    
    /***** Trace related defines *****/
    #define ZB_TRACE_FILE_ID 40124
    
    /****** Application defines ******/
    #define ZB_SWITCH_ENDPOINT          10
    
    #include <ti/log/Log.h>
    
    #include "ti_zigbee_config.h"
    #include "zboss_api.h"
    #include "zb_led_button.h"
    
    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(inc/hw_fcfg.h)
    #include DeviceFamily_constructPath(inc/hw_memmap.h)
    
    /* for button handling */
    #include <ti/drivers/GPIO.h>
    #include "ti_drivers_config.h"
    
    #ifdef ZB_CONFIGURABLE_MEM
    #include "zb_mem_config_lprf3.h"
    #endif
    
    #if !defined ZB_ED_FUNC
    #error define ZB_ED_ROLE to compile the tests
    #endif
    
    /****** Application variables declarations ******/
    /* IEEE address of the device */
    zb_bool_t cmd_in_progress = ZB_FALSE;
    zb_bool_t perform_factory_reset = ZB_FALSE;
    
    /****** Application function declarations ******/
    zb_uint8_t zcl_specific_cluster_cmd_handler(zb_uint8_t param);
    void on_off_read_attr_resp_handler(zb_bufid_t cmd_buf);
    void send_toggle_req(zb_uint8_t param);
    void button_press_handler(zb_uint8_t param);
    
    /****** Cluster declarations ******/
    /* Switch config cluster attributes */
    zb_uint8_t attr_switch_type =
        ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_TOGGLE;
    zb_uint8_t attr_switch_actions =
        ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_DEFAULT_VALUE;
    
    ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST(switch_cfg_attr_list,
                                                           &attr_switch_type,
                                                           &attr_switch_actions);
    /* Basic cluster attributes */
    zb_uint8_t attr_zcl_version  = ZB_ZCL_BASIC_ZCL_VERSION_DEFAULT_VALUE;
    zb_uint8_t attr_power_source = ZB_ZCL_BASIC_POWER_SOURCE_DEFAULT_VALUE;
    ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST(basic_attr_list, &attr_zcl_version, &attr_power_source);
    /* Identify cluster attributes */
    zb_uint16_t attr_identify_time = 0;
    ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &attr_identify_time);
    /* Declare cluster list for the device */
    ZB_HA_DECLARE_ON_OFF_SWITCH_CLUSTER_LIST(on_off_switch_clusters,
                                             switch_cfg_attr_list,
                                             basic_attr_list,
                                             identify_attr_list);
    /* Declare endpoint */
    ZB_HA_DECLARE_ON_OFF_SWITCH_EP(on_off_switch_ep, ZB_SWITCH_ENDPOINT, on_off_switch_clusters);
    /* Declare application's device context for single-endpoint device */
    ZB_HA_DECLARE_ON_OFF_SWITCH_CTX(on_off_switch_ctx, on_off_switch_ep);
    
    void my_main_loop()
    {
      while (1)
      {
        /* ... User code ... */
        zboss_main_loop_iteration();
        /* ... User code ... */
      }
    }
    
    void off_network_attention(zb_uint8_t param)
    {
      ZVUNUSED(param);
      Log_printf(LogModule_Zigbee_App, Log_INFO, "off_network_attention");
      zb_osif_led_toggle(1);
    
      ZB_SCHEDULE_APP_ALARM(off_network_attention, 0, 1 * ZB_TIME_ONE_SECOND);
    }
    
    MAIN()
    {
      ARGV_UNUSED;
    
      /* Global ZBOSS initialization */
      ZB_INIT("on_off_switch");
    
      #ifdef ZB_LONG_ADDR
      // use the address that the customer set in the pre-defined symbols tab
      zb_ieee_addr_t g_long_addr = ZB_LONG_ADDR;
      zb_set_long_address(g_long_addr);
      #else
      /* Set the device's long address to the IEEE address pulling from the FCFG of the device */
      zb_ieee_addr_t ieee_mac_addr;
      ZB_MEMCPY(ieee_mac_addr, fcfg->deviceInfo.macAddr, 8);
      zb_set_long_address(ieee_mac_addr);
      #endif // ZB_LONG_ADDR
    
    #ifdef ZB_COORDINATOR_ROLE
      zb_set_network_coordinator_role(DEFAULT_CHANLIST);
    
      /* Set keepalive mode to mac data poll so sleepy zeds consume less power */
      zb_set_keepalive_mode(MAC_DATA_POLL_KEEPALIVE);
    #ifdef DEFAULT_NWK_KEY
      zb_uint8_t nwk_key[16] = DEFAULT_NWK_KEY;
      zb_secur_setup_nwk_key(nwk_key, 0);
    #endif //DEFAULT_NWK_KEY
    
    #ifdef ZBOSS_REV23
      zb_nwk_set_max_ed_capacity(MAX_ED_CAPACITY);
    #endif //ZBOSS_REV23
    
    #elif defined ZB_ROUTER_ROLE && !defined ZB_COORDINATOR_ROLE
      zb_set_network_router_role(DEFAULT_CHANLIST);
    
    #ifdef ZBOSS_REV23
      zb_nwk_set_max_ed_capacity(MAX_ED_CAPACITY);
    #endif //ZBOSS_REV23
    
      /* Set keepalive mode to mac data poll so sleepy zeds consume less power */
      zb_set_keepalive_mode(MAC_DATA_POLL_KEEPALIVE);
    
    #elif defined ZB_ED_ROLE
      zb_set_network_ed_role(DEFAULT_CHANLIST);
    
      /* Set end-device configuration parameters */
      zb_set_ed_timeout(ED_TIMEOUT_VALUE);
      zb_set_rx_on_when_idle(ED_RX_ALWAYS_ON);
    #if ( ED_RX_ALWAYS_ON == ZB_FALSE )
      zb_set_keepalive_timeout(ZB_MILLISECONDS_TO_BEACON_INTERVAL(ED_POLL_RATE));
      zb_zdo_pim_set_long_poll_interval(ED_POLL_RATE);
    #ifdef DISABLE_TURBO_POLL
      // Disable turbo poll feature
      zb_zdo_pim_permit_turbo_poll(ZB_FALSE);
    #endif // DISABLE_TURBO_POLL
    #endif // ED_RX_ALWAYS_ON
    #endif //ZB_ED_ROLE
    
      zb_set_nvram_erase_at_start(ZB_FALSE);
    
      /* Register device ZCL context */
      ZB_AF_REGISTER_DEVICE_CTX(&on_off_switch_ctx);
      /* Register cluster commands handler for a specific endpoint */
      ZB_AF_SET_ENDPOINT_HANDLER(ZB_SWITCH_ENDPOINT, zcl_specific_cluster_cmd_handler);
    
      /* Initiate the stack start without starting the commissioning */
      if (zboss_start_no_autostart() != RET_OK)
      {
        Log_printf(LogModule_Zigbee_App, Log_ERROR, "zboss_start failed");
      }
      else
      {
        GPIO_setConfig(CONFIG_GPIO_BTN1, GPIO_CFG_IN_PU);
        GPIO_setConfig(CONFIG_GPIO_BTN2, GPIO_CFG_IN_PU);
        // if either button 1 or button 2 gets pressed
        zb_bool_t sideButtonPressed = ((GPIO_read((zb_uint8_t)CONFIG_GPIO_BTN1) == 0U) || (GPIO_read((zb_uint8_t)CONFIG_GPIO_BTN2) == 0U));
        // then perform a factory reset
        if (sideButtonPressed)
        {
          perform_factory_reset = ZB_TRUE;
          Log_printf(LogModule_Zigbee_App, Log_INFO, "perform factory reset");
        }
    
        zb_osif_led_button_init();
    #ifndef ZB_COORDINATOR_ROLE
        ZB_SCHEDULE_APP_ALARM(off_network_attention, 0, 1 * ZB_TIME_ONE_SECOND);
    #endif /* ZB_COORDINATOR_ROLE */
    
        /* Call the application-specific main loop */
        my_main_loop();
      }
    
      MAIN_RETURN(0);
    }
    
    static zb_bool_t finding_binding_cb(zb_int16_t status,
                                        zb_ieee_addr_t addr,
                                        zb_uint8_t ep,
                                        zb_uint16_t cluster)
    {
      /* Unused without trace. */
      ZVUNUSED(status);
      ZVUNUSED(addr);
      ZVUNUSED(ep);
      ZVUNUSED(cluster);
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "finding_binding_cb status %d addr %x ep %d cluster %d",
                 status, ((zb_uint32_t *)addr)[0], ep, cluster);
      return ZB_TRUE;
    }
    
    zb_uint8_t zcl_specific_cluster_cmd_handler(zb_uint8_t param)
    {
      zb_zcl_parsed_hdr_t *cmd_info = ZB_BUF_GET_PARAM(param, zb_zcl_parsed_hdr_t);
      zb_bool_t unknown_cmd_received = ZB_TRUE;
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "> zcl_specific_cluster_cmd_handler %i", param);
      Log_printf(LogModule_Zigbee_App, Log_INFO, "payload size: %i", zb_buf_len(param));
    
      if (cmd_info->cmd_direction == ZB_ZCL_FRAME_DIRECTION_TO_CLI)
      {
        if (cmd_info->cmd_id == ZB_ZCL_CMD_DEFAULT_RESP)
        {
          unknown_cmd_received = ZB_FALSE;
    
          cmd_in_progress = ZB_FALSE;
    
          zb_buf_free(param);
        }
      }
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "< zcl_specific_cluster_cmd_handler %i", param);
      return ! unknown_cmd_received;
    }
    
    void send_toggle_req(zb_uint8_t param)
    {
      zb_uint16_t addr = 0;
    
      ZB_ASSERT(param);
    
      if (ZB_JOINED()  && !cmd_in_progress)
      {
        cmd_in_progress = ZB_TRUE;
        Log_printf(LogModule_Zigbee_App, Log_INFO, "send_toggle_req %d - send toggle", param);
    
        /* Destination address and endpoint are unknown; command will be sent via binding */
        ZB_ZCL_ON_OFF_SEND_TOGGLE_REQ(
          param,
          addr,
          ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
          0,
          ZB_SWITCH_ENDPOINT,
          ZB_AF_HA_PROFILE_ID,
          ZB_FALSE, NULL);
      }
      else
      {
        Log_printf(LogModule_Zigbee_App, Log_INFO, "send_toggle_req %d - not joined", param);
        zb_buf_free(param);
      }
    }
    
    void restart_commissioning(zb_uint8_t param)
    {
      ZVUNUSED(param);
      bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING);
    }
    
    void button_press_handler(zb_uint8_t param)
    {
      if (!param)
      {
        /* Button is pressed, gets buffer for outgoing command */
        zb_buf_get_out_delayed(button_press_handler);
      }
      else
      {
        Log_printf(LogModule_Zigbee_App, Log_INFO, "button_press_handler %d", param);
        send_toggle_req(param);
    #ifndef ZB_USE_BUTTONS
        /* Do not have buttons in simulator - just start periodic on/off sending */
        ZB_SCHEDULE_APP_ALARM(button_press_handler, 0, 7 * ZB_TIME_ONE_SECOND);
    #endif
      }
    }
    
    void permit_joining_cb(zb_uint8_t param)
    {
      Log_printf(LogModule_Zigbee_App, Log_INFO, "permit joining done");
      zb_buf_free(param);
    }
    
    void start_finding_binding(zb_uint8_t param)
    {
      ZVUNUSED(param);
    
      Log_printf(LogModule_Zigbee_App, Log_INFO, "Successful steering, start f&b initiator");
      zb_bdb_finding_binding_initiator(ZB_SWITCH_ENDPOINT, finding_binding_cb);
    }
    
    void set_tx_power(zb_int8_t power)
    {
      zb_uint32_t chanlist = DEFAULT_CHANLIST;
      for (zb_uint8_t i = 0; i < 32; i++) {
        if (chanlist & (1U << i)) {
          zb_bufid_t buf = zb_buf_get_out();
          if (!buf)
          {
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "no buffer available");
            return;
          }
    
          zb_tx_power_params_t *power_params = (zb_tx_power_params_t *)zb_buf_begin(buf);
          power_params->status = RET_OK;
          power_params->page = 0;
          power_params->channel = i;
          power_params->tx_power = power;
          power_params->cb = NULL;
    
          zb_set_tx_power_async(buf);
        }
      }
    }
    
    void zboss_signal_handler(zb_uint8_t param)
    {
      zb_zdo_app_signal_hdr_t *sg_p = NULL;
      zb_zdo_app_signal_type_t sig = zb_get_app_signal(param, &sg_p);
      zb_bufid_t buf;
      zb_bufid_t req_buf = 0;
      zb_zdo_mgmt_permit_joining_req_param_t *req_param;
    
      if (ZB_GET_APP_SIGNAL_STATUS(param) == 0)
      {
        switch(sig)
        {
          case ZB_ZDO_SIGNAL_SKIP_STARTUP:
    #ifndef ZB_MACSPLIT_HOST
            Log_printf(LogModule_Zigbee_App, Log_INFO, "ZB_ZDO_SIGNAL_SKIP_STARTUP: boot, not started yet");
            set_tx_power(DEFAULT_TX_PWR);
            zboss_start_continue();
    #endif /* ZB_MACSPLIT_HOST */
            break;
    
    #ifdef ZB_MACSPLIT_HOST
          case ZB_MACSPLIT_DEVICE_BOOT:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "ZB_MACSPLIT_DEVICE_BOOT: boot, not started yet");
            set_tx_power(DEFAULT_TX_PWR);
            zboss_start_continue();
            break;
    #endif /* ZB_MACSPLIT_HOST */
          case ZB_BDB_SIGNAL_DEVICE_FIRST_START:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "FIRST_START: start steering");
            if (perform_factory_reset)
            {
              // passing in 0 as the parameter means that a buffer will be allocated automatically for the reset
              zb_bdb_reset_via_local_action(0);
              perform_factory_reset = ZB_FALSE;
            }
            set_tx_power(DEFAULT_TX_PWR);
            bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING);
    
            buf = zb_buf_get_out();
            if (!buf)
            {
              Log_printf(LogModule_Zigbee_App, Log_WARNING, "no buffer available");
              break;
            }
    
            req_param = ZB_BUF_GET_PARAM(buf, zb_zdo_mgmt_permit_joining_req_param_t);
    
            req_param->dest_addr = 0xfffc;
            req_param->permit_duration = 0;
            req_param->tc_significance = 1;
    
            zb_zdo_mgmt_permit_joining_req(buf, permit_joining_cb);
    
    #ifdef ZB_USE_BUTTONS
            zb_button_register_handler(0, 0, button_press_handler);
    #endif /* ZB_USE_BUTTONS */
            break;
          case ZB_BDB_SIGNAL_DEVICE_REBOOT:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Device RESTARTED OK");
            if (perform_factory_reset)
            {
              Log_printf(LogModule_Zigbee_App, Log_INFO, "Performing a factory reset.");
              zb_bdb_reset_via_local_action(0);
              perform_factory_reset = ZB_FALSE;
            }
            else
            {
              ZB_SCHEDULE_APP_ALARM_CANCEL(off_network_attention, ZB_ALARM_ANY_PARAM);
              zb_osif_led_off(1);
            }
    #ifdef ZB_USE_BUTTONS
            zb_button_register_handler(0, 0, button_press_handler);
    #endif /* ZB_USE_BUTTONS */
            break;
    #ifdef ZB_COORDINATOR_ROLE
          case ZB_ZDO_SIGNAL_DEVICE_ANNCE:
    #else
          case ZB_BDB_SIGNAL_TC_REJOIN_DONE:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "TC rejoin is completed successfully");
          case ZB_BDB_SIGNAL_STEERING:
    #endif
          {
            zb_nwk_device_type_t device_type = ZB_NWK_DEVICE_TYPE_NONE;
            device_type = zb_get_device_type();
            ZVUNUSED(device_type);
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Device (%d) STARTED OK", device_type);
            ZB_SCHEDULE_APP_ALARM(start_finding_binding, 0, 3 * ZB_TIME_ONE_SECOND);
            ZB_SCHEDULE_APP_ALARM_CANCEL(off_network_attention, ZB_ALARM_ANY_PARAM);
    #ifdef ZB_USE_BUTTONS
            zb_button_register_handler(0, 0, button_press_handler);
    #endif /* ZB_USE_BUTTONS */
            zb_osif_led_off(1);
            break;
          }
    
          case ZB_BDB_SIGNAL_FINDING_AND_BINDING_INITIATOR_FINISHED:
          {
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Finding&binding done");
    #ifndef ZB_USE_BUTTONS
            /* Do not have buttons in simulator - just start periodic on/off sending */
            cmd_in_progress = ZB_FALSE;
            ZB_SCHEDULE_APP_ALARM_CANCEL(button_press_handler, ZB_ALARM_ANY_PARAM);
            ZB_SCHEDULE_APP_ALARM(button_press_handler, 0, 7 * ZB_TIME_ONE_SECOND);
    #endif
          }
          break;
    
          case ZB_ZDO_SIGNAL_LEAVE:
          break;
          case ZB_COMMON_SIGNAL_CAN_SLEEP:
          {
    #ifdef ZB_USE_SLEEP
            zb_sleep_now();
    #endif
            break;
          }
          case ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY:
          {
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Production config is ready");
            break;
          }
    
          default:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Unknown signal %d, do nothing", sig);
        }
      }
      else
      {
        switch (sig)
        {
          case ZB_BDB_SIGNAL_DEVICE_FIRST_START:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Device can not find any network on start, so try to perform network steering");
            ZB_SCHEDULE_APP_ALARM(restart_commissioning, 0, 10 * ZB_TIME_ONE_SECOND);
            break; /* ZB_BDB_SIGNAL_DEVICE_FIRST_START */
    
          case ZB_BDB_SIGNAL_DEVICE_REBOOT:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Device can not find any network on restart");
    
            if (zb_bdb_is_factory_new())
            {
              /* Device tried to perform TC rejoin after reboot and lost its authentication flag.
               * Do nothing here and wait for ZB_BDB_SIGNAL_TC_REJOIN_DONE to handle TC rejoin error */
              Log_printf(LogModule_Zigbee_App, Log_WARNING, "Device lost authentication flag");
            }
            else
            {
              /* Device tried to perform secure rejoin, but didn't found any networks or can't decrypt Rejoin Response
               * (it is possible when Trust Center changes network key when ZED is powered off) */
              Log_printf(LogModule_Zigbee_App, Log_WARNING, "Device is still authenticated, try to perform TC rejoin");
              ZB_SCHEDULE_APP_ALARM(zb_bdb_initiate_tc_rejoin, 0, ZB_TIME_ONE_SECOND);
            }
            break; /* ZB_BDB_SIGNAL_DEVICE_REBOOT */
    
          case ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY:
            Log_printf(LogModule_Zigbee_App, Log_INFO, "Production config is not present or invalid");
            break; /* ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY */
    
          case ZB_BDB_SIGNAL_TC_REJOIN_DONE:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "TC rejoin failed, so try it again with interval");
    
            ZB_SCHEDULE_APP_ALARM(zb_bdb_initiate_tc_rejoin, 0, 3 * ZB_TIME_ONE_SECOND);
            break; /* ZB_BDB_SIGNAL_TC_REJOIN_DONE */
    
          case ZB_BDB_SIGNAL_STEERING:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Steering failed, retrying again in 10 seconds");
            ZB_SCHEDULE_APP_ALARM(restart_commissioning, 0, 10 * ZB_TIME_ONE_SECOND);
            break; /* ZB_BDB_SIGNAL_STEERING */
    
          default:
            Log_printf(LogModule_Zigbee_App, Log_WARNING, "Unknown signal %hd with error status, do nothing", sig);
            break;
        }
      }
    
      if (param)
      {
        zb_buf_free(param);
      }
    }
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 19
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 12
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 19
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Network operation 06,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Unknown signal 66
    
    Cortex_M0P: Unknown signal 47
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 48
    
    Cortex_M0P: Unknown signal 2
    
    Cortex_M0P: Unknown signal 19
    
    Cortex_M0P: Unknown signal 53
    
    Cortex_M0P: Unknown signal 59
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Network operation 00,nwk_addr = e344
    
    Cortex_M0P: Unknown signal 66
    

  • This is the code I used for testing the onoff_light as the coordinator. I only added a print statement for the signal value. I still used onoff_switch as the terminal

    I reproduced your test and was not able to replicate the behavior.  There are no "Network operation 00" in my UART log, only "Unknown signal" which is expected for the default case (recommend adding a break at the end for consistency).  My ZC never resets.  I'm using a ZR for the switch but I don't believe this would make any difference.

    The coordinator remained powered on, and after the terminal device was connected, it was reprogrammed

    Are you aware that without additional steps the re-programmed switch will not be able to rejoin the ZC light assuming that the 180 second permit join window has ended?  As with my test the switch blinks the red LED but is not able to communicate with the ZC after being re-programmed since its NV flash memory has been erased.  The ZC has no actions for which ZB_NWK_COMMAND_STATUS_INDIRECT_TRANSACTION_EXPIRY and ZB_NWK_COMMAND_STATUS_NO_ROUTE_AVAILABLE apply.

    Regards,
    Ryan