This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Zigbee Task halts on Leave Request

Hi,

We have been working with an end device based on nRF52840 with nRF5_SDK_for_Thread_and_Zigbee_v4.0.0_dc7186b and FreeRtos

This device has some bindings already set to the coordinator.

When it receives a Leave Request from coordinator, the Zigbee Stack gets stucked on zb_address_reset() function. Because of that, the Zigbee task remains blocked for the rest of the time.

Which should be the reason to halt at this point and how this could be avoided?

Regards,

Santiago

Parents Reply Children
  • ZB_ZDO_SIGNAL_LEAVE is never called. In fact, the description of this signal says that is called when the device leaves the network by sending leave command. 

    Find code below:

    case ZB_ZDO_SIGNAL_LEAVE:
            /* This signal is generated when the device itself has left the network by sending leave command.
              *
              * Note: this signal will be generated if the device tries to join legacy Zigbee network and the TCLK
              *       exchange cannot be completed. In such situation, the ZB_BDB_NETWORK_STEERING signal will be generated
              *       afterwards, so this case may be left unimplemented.
              */
            if (status == RET_OK)
            {
              zb_zdo_signal_leave_params_t * p_leave_params = ZB_ZDO_SIGNAL_GET_PARAMS(p_sg_p, zb_zdo_signal_leave_params_t);
              ZIGBEE_LOG_INFO("Network left (leave type: %d)", p_leave_params->leave_type);
    
              if(ZIGBEE_STATE_JOINING != zigbee.state)
              {
                App_Zigbee_Status(ZIGBEE_STATUS_DISCONNECTED);
                Zigbee_Fsm(ZIGBEE_STATE_DISCONNECTED);
              }
            }
            else
            {
              ZIGBEE_LOG_ERROR("Unable to leave network (status: %d)", status);
            }
     
    
          break;

  • H Santiago,

    The end device sends a leave command in your sniffer log, so it does leave, and therefore ZB_ZDO_SIGNAL_LEAVE is called. This signal is generated when the device itself has left the network by sending leave command. ZB_ZDO_SIGNAL_LEAVE is called even if the leave request is from the coordinator. You can test this yourself by using the CLI Agent example and issuing the 'zdo mgmt_leave' command, and you will see that "Network left" is printed.

    Can you please debug your code using breakpoints so that you can see what's happening in your program? You can put the breakpoints at the if statements in the code above, as well as at App_Zigbee_Status() and Zigbee_Fsm().

    What is zigbee.state, and what does the functions App_Zigbee_Status() and Zigbee_Fsm() do? 

    Best regards,

    Marte

  • Hi Santiago,

    I just got a response from the Zigbee team. They were able to reproduce the problem, with both nRF5 SDK T&Z and with NCS, so it seems the problem is with the Zigbee stack (ZBOSS). The problem has been reported to DSR in ZBOSS Open Initiative (ZOI).

    Best regards,

    Marte

  • Hi Marte,

    Thanks for your response. Is there any workaround?

    Regards,

  • Hi Santiago,

    I don't know of any workaround yet, but our Zigbee team is looking into it to try and see if there's an obvious fix besides waiting for a response from DSR. However, I can't give an estimate on when this will be done, as it might take some time. I'll let you know as soon as I know more.

    Best regards,

    Marte

Related