ZigBee Application crash - ERROR 29 [RET_OVERFLOW] at [...]zigbee_app_utils.c:849

Application crashes with the following log

[06:45:22.727,691] <err> zigbee_app_utils: ERROR 29 [RET_OVERFLOW] at WEST_TOPDIR/nrf/subsys/zigbee/lib/zigbee_app_utils/zigbee_app_utils.c:849
[06:45:22.727,691] <err> zboss_osif: ZBOSS fatal error occurred
The relevant lines from zigbee_app_utils
 
#if defined CONFIG_ZIGBEE_ROLE_END_DEVICE
wait_for_user_input = false;
is_rejoin_start_scheduled = false;

zb_ret_t zb_err_code = ZB_SCHEDULE_APP_ALARM(
stop_network_rejoin,
ZB_TRUE,
ZB_MILLISECONDS_TO_BEACON_INTERVAL(
ZB_DEV_REJOIN_TIMEOUT_MS));
ZB_ERROR_CHECK(zb_err_code);
#endif
It seems that the Alarm cannot be scheduled due to RET_OVERFLOW.

- The implementation of the signal handler is here https://github.com/Rogger/schneggi-sensor/blob/64b2408f1053a15622c618249d887ca7694eb250/src/main.c#L704, in there is as well the call to app utils.
Context:
SDK & toolchain in use 2.5.0
Any help or guidance is highly appreciated, thank you in advance
Best Regards
Michael
Parents Reply Children
  • I don't know exactly what the issue is. Though it could be like pwpot was suggesting here, that you are scheduling one of the callbacks multiple times without proper cancellation, or that you have recursive tasks. Could it be that you are also not freeing the buffers?

    You might want to check all the places where you call ZB_SCHEDULE_APP_CALLBACK() or ZB_SCHEDULE_APP_ALARM().

    Could you also try lowering down the Q_SIZE again, to see if maybe that maybe was the only thing that postponed the error?

    Regards,

    Elfving

  • I agree, it looks like an issue related to not freeing buffers or not canceled scheduled callbacks.

    But since I can reproduce the issue with the light bulb example (not modified, SDK 2.5.2) I thin it might be a bug in the ZigBee stack.

    I will try to dig deeper to find more information.

  • Hi Rogger, 

    I went through your code one more time and I found something. 
    I think calling 
    ZB_SCHEDULE_APP_ALARM(sensor_loop, ZB_ALARM_ANY_PARAM,
    ZB_MILLISECONDS_TO_BEACON_INTERVAL(0));
    in main is not necessary because your sensor_loop first call will be scheduled by the ZB_ZDO_SIGNAL_SKIP_STARTUP signal anyway. 

    I suggest sth like this: 

     int main(void)
     {
        ...
        ...
     
        /* Start Zigbee default thread */
    	zigbee_enable();
        while (!zigbee_is_stack_started()) {
            /* Sleep is mandatory (Main thread goes to sleep, ZBOSS thread starts working):
             * Allow the ZBOSS Thread to be created and started.
             */
            k_msleep(200);
        }
        
        return 0;
    }

Related