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)

Related