This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

[Update Zigbee SDK] Problem when update from zigbee and thread 4.1.0 to zigbee and thread 4.2.0

Hi guys,

I have a question about migration guide from the old 4.1.0 thread and zigbee sdk to 4.2.0.

The story is that I have this project running 4.1.0 on my custom board with some bugs that seems to be fixed in 4.2.0 due to the release note. When I tried to update the SDK by pasting the new SDK in and then change SDK config as well as the makefile. For some more relevant context, the code I used as reference is the zigbee example light bulb to modify the project but after I successfully compile and flash the device, in zigbee_default_signal_handler I receive signal ID 22 which is the device can sleep signal but in the init system I have put it as router role. I also update the zigbee_helpers.c with

ZB_ERROR_CHECK(zb_zcl_set_backward_comp_mode(ZB_ZCL_AUTO_MODE));

ZB_ERROR_CHECK(zb_zcl_set_backward_compatible_statuses_mode(ZB_ZCL_STATUSES_ZCL8_MODE));

And as far as I know the this signal is only trigger when calling zb_sleep_now in the old SDK. So my question is that in the new SDK is there any part to be consider when init the system to not accidently trigger this behavior.

Thank you for any helps,

Best regards,

Tu

Parents
  • Ok, Is it possible some specific modification in your application triggered this issue? I will also check with our development team for the possible cause. Let's keep each other updated.

    Best regards,

    Charlie

  • Hi Charlie

    So, I have some update on the problem. So the problem is that I have this 

    void zboss_signal_handler(zb_bufid_t bufid)
    {
        zb_zdo_app_signal_hdr_t *p_sg_p = NULL;
        zb_zdo_app_signal_type_t sig = zb_get_app_signal(bufid, &p_sg_p);
        zb_ret_t status = ZB_GET_APP_SIGNAL_STATUS(bufid);
        /*NRF_LOG_INFO("zboss_signal_handler signal %d", sig);*/
        switch (sig) {
            default:
                ZB_ERROR_CHECK(zigbee_default_signal_handler(bufid));
            break;
        }
    }
            

    If I uncomment the Log in this funtion it will pop up repeatedly signal 22. But the weird thing is that in the zigbee_default_signal_handler(bufid), when signal 22 hit, it will go to default like in this code. 

            default:
                /* Unimplemented signal. For more information see: zb_zdo_app_signal_type_e and zb_ret_e. */
                NRF_LOG_INFO("Unimplemented signal (signal: %d, status: %d)", sig, status);
                break;
    

    But I can never see the log pop up which means that The code in default signal handler has do some thing to filter out the signal. But still I can not figure out how to achieve the same outcome in the self implemented zboss_signal_handler

    I also test with the devkit pca10100 and have the same outcome. I also attach the code for you to check it out

    3884.light_bulb.zip

    Thank you

    Best regards,

    Tu

  • Hi Tu,

    Shouldn't this singal be processed by the following codes in zigbee_default_signal_handler function?

            case ZB_COMMON_SIGNAL_CAN_SLEEP:
            //NRF_LOG_INFO("zboss_signal_handler signal %d", sig);
                /* Zigbee stack can enter sleep state.
                 * If the application wants to proceed, it should call zb_sleep_now() function.
                 *
                 * Note: if the application shares some resources between Zigbee stack and other tasks/contexts,
                 *       device disabling should be overwritten by implementing one of the weak functions inside zb_nrf52840_common.c.
                 */
                zb_sleep_now();
                break;

    Best regards,

    Charlie

  • Hi Charlie,

    Well in the light bulb example, the device is a router so it will not process that signal but will put it in default case. If I remember correctly unless the device plays the role of a end device, it will never handle that signal.

    #ifdef ZB_USE_SLEEP
            case ZB_COMMON_SIGNAL_CAN_SLEEP:
                /* Zigbee stack can enter sleep state.
                 * If the application wants to proceed, it should call zb_sleep_now() function.
                 *
                 * Note: if the application shares some resources between Zigbee stack and other tasks/contexts,
                 *       device disabling should be overwritten by implementing one of the weak functions inside zb_nrf52840_common.c.
                 */
                zb_sleep_now();
                break;
    #endif
    

    As you can see the handle of this signal is only enable with ZB_USE_SLEEP is defined and that macro is only there if the device is ED as in the code below

    #ifdef ZB_ED_ROLE
    #define ZB_USE_SLEEP
    #endif
    

    So It does not really explain my question which is why in my void zboss_signal_handler(zb_bufid_t bufid) if I put the log there it will show that there are signal 22(ZB_SIGNAL_CAN_SLEEP) coming repeatedly, but when the signal is handled by zigbee_default_signal_handler , somehow the defaults handler ignore it.

    I want to know how to do it just to verify if this behavior is normal and if it will have any effect on the overall performance of the system.

    Looking forward to hearing from you,

    Best regards,

    Tu

Reply
  • Hi Charlie,

    Well in the light bulb example, the device is a router so it will not process that signal but will put it in default case. If I remember correctly unless the device plays the role of a end device, it will never handle that signal.

    #ifdef ZB_USE_SLEEP
            case ZB_COMMON_SIGNAL_CAN_SLEEP:
                /* Zigbee stack can enter sleep state.
                 * If the application wants to proceed, it should call zb_sleep_now() function.
                 *
                 * Note: if the application shares some resources between Zigbee stack and other tasks/contexts,
                 *       device disabling should be overwritten by implementing one of the weak functions inside zb_nrf52840_common.c.
                 */
                zb_sleep_now();
                break;
    #endif
    

    As you can see the handle of this signal is only enable with ZB_USE_SLEEP is defined and that macro is only there if the device is ED as in the code below

    #ifdef ZB_ED_ROLE
    #define ZB_USE_SLEEP
    #endif
    

    So It does not really explain my question which is why in my void zboss_signal_handler(zb_bufid_t bufid) if I put the log there it will show that there are signal 22(ZB_SIGNAL_CAN_SLEEP) coming repeatedly, but when the signal is handled by zigbee_default_signal_handler , somehow the defaults handler ignore it.

    I want to know how to do it just to verify if this behavior is normal and if it will have any effect on the overall performance of the system.

    Looking forward to hearing from you,

    Best regards,

    Tu

Children
No Data
Related