Skip to main content
Associate III
July 23, 2024
Question

Zigbee end device not waking up in sleep mode

  • July 23, 2024
  • 10 replies
  • 5002 views

Hey,

I have two problems regarding custom clusters and sleepy end devices. I want to create an SED that periodically sends custom long string messages (via attribute reporting) to a coordinator.

1.Question:

For this I implemented a custom cluster with a custom long string character attribute. For testing I only write to the attribute once the SED starts up.

enum ZclStatusCodeT status;
uint8_t Custom_str[255] = " PAYLOAD";
Custom_str[0] = 68; // length of string (ZCL format) LSB
Custom_str[1] = 0; // length of string (ZCL format) MSB
status = ZbZclAttrStringWriteLong(zigbee_app_info.custom_ls_server, MY_ZCL_DEV_LS, Custom_str);
APP_DBG("Attribute write status = %d", status);

This works as intended. My motivation to use the custom cluster was the ability to send long custom strings. If I change Custom_str[0] = 68; to Custom_str[0] = 100; the reporting stops and the message does not comes through (attributeWrite still successful). Fragmentation should be enabled by default in custom cluster, but apparently messages do not arrive in this configuration. Any hints on what might cause this issue are appreciated.

2.Question:

For the sleepiness of the end devices i oriented on the Zigbee_OnOff_Client_SED example. I enabled sleepy mode in the Zigbee Stack and made sure the following lines are present.

/* Enabling Stop mode */
UTIL_LPM_SetStopMode(1U << CFG_LPM_APP, UTIL_LPM_ENABLE);
UTIL_LPM_SetOffMode(1U << CFG_LPM_APP, UTIL_LPM_DISABLE);

Furthermore, NVIC configuration is the same. Despite this, the end devices do not wake up for performing the periodic long string attribute report. What might be the issue here?

Best regards and thanks for the help!

10 replies

Technical Moderator
August 6, 2024

Hello,

Please find below my answers to your questions :

1- We have raised an internal ticket 187674 to analyze the case where the reporting does not work with a data length >= 82 , we will reach out to you asap.

2-  To configure a Zigbee device as SED, you have to make sure first that your device is flashed with the M0 binary  stm32wb5x_Zigbee_RFD_fw.bin and to enable the flag CFG_LPM_SUPPORTED, if this is the case, please share the logs and wireshark capture to further analyze.

Best regards,

Ouadi

NameAuthor
Associate III
August 12, 2024

Hello Ouadi,

thanks for the help.

2- I uploaded the M0 binary stm32wb5x_Zigbee_RFD_fw.bin, enabled sleepy mode and and to enabled the flag CFG_LPM_SUPPORTED. Unfortunately also the logging does not work. This is my current configuration:

1JPG.JPG

2.JPG

3.JPG

 

Best regards

Technical Moderator
August 12, 2024

Hello,

The debug trace feature is disabled by default with the flag ( CFG_DBG_TRACE )  for applications that needs to activate the full low power mode, you may enable it manually on your code => CFG_DBG_TRACE with the desired level ( only for debug).

Best regards,

Ouadi

Technical Moderator
August 12, 2024

Hi,

Could you please share your UART configuration and DMA settings ? 

You need to make sure that DMA is activated as the DbgOutputTraces function uses the DMA to transmit data. 

Regards,

Ouadi

NameAuthor
Associate III
August 12, 2024

Name_0-1723477441989.png

Name_1-1723477477534.png

Name_2-1723477535763.png

I followed the instructions given in the configuration interface.

Best regards

 

Technical Moderator
August 12, 2024

Hi,

Looking at your settings you have to disable the Hardware flow control RTS/CTS which is only used for RS232 communication. 

Best regards,

Ouadi

NameAuthor
Associate III
August 12, 2024

Hello Ouadi,

I have to apologize. I am working on a MicroMod Main Board and apparently the RX and TX lines are routed to an external connector, so I am not able to receive any logs from the device without further hardware. Is there any way to get some debug information of the Zigbee Stack via the SWD?
Best regards

Technical Moderator
August 13, 2024

Hi,

If the UART Tx and Rx are not configured as it should depending on your hardware this explains why the traces are not working..

The ZigBee stack debug information are sent over the IPCC to M4 and displayed through the UART, there is some other mechanisms to enable the traces as ITM / ETM you can explore, but this implies a code modification with no guarantee of its performance.

Best regards,

Ouadi

NameAuthor
Associate III
August 19, 2024

Hey,

I got my hands on a Nucleo STM32WB55RGV6 MCU and tried to get a simple example with activated Zigbee and Log to run. USART1 is working fine via the debugger as long, as Zigbee is not activated in CubeMX. I tried switching on and off the recommended paramters from CFG_HW_USART1_ENABLED, but no output at all. Deactivating Zigbee results in the USART working fine again.

My configuration and (simple) code is appended below:

im1.JPG

im3.JPG

im2.JPG

im4.JPG

im5.JPG

Best regards

Technical Moderator
August 19, 2024

Hi,

Please make sure to set the right settings on Zigbee CubeMX configurator, as an example you can have a look on the different examples activating Zigbee on our ST Github

Also, you have to flash your device with Zigbee M0 binary to be able to run zigbee stack.

Regards,

Ouadi

NameAuthor
Associate III
August 19, 2024

Hey Ouadi,

Newest RFD Zigbee stack is flashed. I copied the settings from the Zigbee_OnOff_Client_SED example, including all pinout&config, clock, project manager. No output on the serial. I also tried uploading the example project directly, which gives compilation errors on two different machines (fresh cloned repository).

Best regards

Technical Moderator
August 19, 2024

Hi,

Zigbee SED application uses the Full Low Power mode with CFG_DEBUG_TRACE disabled by default as mentioned previously to save the consumption, You have to enable this setting to be able to activate the trace.

Kind regards,

Ouadi

NameAuthor
Associate III
September 17, 2024

Hello Ouadi,

I solved to enable the traces on the sleepy end device (as mentioned in my other post) and now want to go back to the original problem of the sleepy end device not waking up after connection to the coordinator.

I appended the log below.

Best regards

SleepyLog.JPG

Technical Moderator
September 18, 2024

Hello,

Nice to hear that you were able to solve the traces. 

Now for the LPM mode, I assume that there is something wrong on your application avoiding the device to wake up from sleep mode.

I recommend to look at the example Zigbee_OnOff_Client_SED  where the sleep mode is activated and the device wakes up periodically with no issues. 

Regards,

Ouadi

NameAuthor
Associate III
August 26, 2024

Hello Ouadi,

I found a possibility to read the serial output from the micromod development board.

I started with a fresh project to eliminate possible errors or incompatibilities from the old project.

First, I set up only the standard USART1 output on STM32WB5MMGHx PA9 and PA10. Serial output works as expected in this simple setup.

Now, I want to continue as simple as possible to get the debug traces to work when running Zigbee. For this, I set up the device to work as coordinator/reduced function device, with all settings left to standard (no sleep mode), except the ones to get the debug traces to work. The projects builds without errors or warnings. Result: no output at all, despite the serial working before.

I appended my configuration here:

zigbee1.JPG

zigbee2.JPG

functioncalls.JPG

usart1.JPG

usart2.JPG

 

I appreciate any help!

 

Best reagards

NameAuthor
Associate III
September 9, 2024

Hello Ouadi,

I tried changing Advanced Settings in Project Manager without success. What could be the issue of traces not being working here?

Thanks and best regards

NameAuthor
Associate III
February 25, 2025

Hello Ouadi,

we are still waiting for a reply on ticket 187674. When can we expect a response?

Best regards