Zigbee Application Rebooting on nRF52840 with SDK v2.9.0

Hi everyone,

I’m working on a Zigbee application using the nRF52840, and I’ve been experiencing periodic reboots that I cannot figure out how to resolve. I’ve already updated to the latest SDK and toolchain version (v2.9.0), but the issue persists.

From my investigation, the reboot always seems to happen when my application receives a Zigbee packet and attempts to process it in the callback function. Below is the relevant part of my code:

zb_af_set_data_indication(data_indication_cb); // Set callback for APS frame received

// Callback function executed when AF gets APS packet
zb_uint8_t data_indication_cb(zb_bufid_t bufid)
{
    if (!bufid)
    {
        if (zb_buf_is_oom_state()) {
            // Handle Out Of Memory state
            LOG_ERR("Buffer pool is out of memory!\n");
        }
        if (zb_buf_memory_low()) {
            // Handle low memory state
            LOG_WRN("Warning: Buffer pool memory is running low!\n");
        }

        // Trace the buffer statistics for debugging purposes
        zb_buf_oom_trace();
        LOG_ERR("Error: bufid is NULL data_indication_cb beginning: bufid status %d", zb_buf_get_status(bufid));
        return ZB_FALSE;
    }

    // Processing of the buffer would go here
}
 

Whenever the callback is triggered with a NULL bufid, my application logs the following error before the fatal crash:

[00:05:55.251,190] <err> main: Error: bufid is NULL data_indication_cb beggining: bufid status 1914463768
[00:05:55.251,312] <err> zboss_osif: ZBOSS fatal error occurred
▒[00:00:00.000,305] <err> qspi_nor: JEDEC id [ff ff ff] expect [c2 28 17]

I have tried analyzing the coredump, but I cannot consistently replicate the issue. It appears to occur randomly but always when processing incoming Zigbee packets.

Additionally, I have never seen the “Buffer pool memory is running low” or “Buffer pool is out of memory” messages in the logs, which suggests the problem might not be related to memory depletion.

Does anyone have insights into what could be causing this behavior? Are there specific steps I should follow to debug or handle the NULL buffer more gracefully?

Any help would be greatly appreciated.

Thanks!

Related