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

zephyr zigbee shell logging zcl packets

Hi

If I log to RTT I can see ZCL packets decoded on the log using minimal logging but when i tried it with full logging (to get that on the zigbee_shell on the uart) I got this assertion:

ASSERTION FAIL @ WEST_TOPDIR/zephyr/subsys/logging/log_core.c:174

..and when running without assertions this error message:

[00:00:15.678,527] <err> log: argument 0 in source zboss_osif.eprxzcl log message "%s" missinglog_strdup().

This is my fix, along with configuring the log_dup to accept longer strings.

diff --git a/subsys/zigbee/lib/zigbee_logger_ep/zigbee_logger_eprxzcl.c b/subsys/zigbee/lib/zigbee_logger_ep/zigbee_logger_eprxzcl.c
index 15bcb288..f79f7dc4 100644
--- a/subsys/zigbee/lib/zigbee_logger_ep/zigbee_logger_eprxzcl.c
+++ b/subsys/zigbee/lib/zigbee_logger_ep/zigbee_logger_eprxzcl.c
@@ -248,7 +248,7 @@ zb_uint8_t zigbee_logger_eprxzcl_ep_handler(zb_bufid_t bufid)
 
                *log_message_curr = '\0';
 
-               LOG_INST_INF(logger.inst, "%s", log_message);
+               LOG_INST_INF(logger.inst, "%s", log_strdup(log_message));
        }
 
        return ZB_FALSE;

CONFIG_LOG_STRDUP_MAX_STRING=255

Is this a known issue? Or have I done something wrong?


(nrf connect sdk 1.5.1)

Parents Reply
  • Hi,

    I just wanted to update you on this issue. 

    Our developers were able to confirm this bug. They found that this issue can be observed when using any logging backend, not just RTT, because it is a problem with a message processing in the Zigbee endpoint handler before the message is passed to Zephyr's logger.

    The proposed fix was very welcome, and it will be submitted as soon as possible. Once again, thank you for reporting this and including a fix!

    Best regards,

    Marte

Children
No Data
Related