cancel
Showing results for 
Search instead for 
Did you mean: 

Zigbee Persistent storage and control issue on STM32WB5MMG

HardWins
Associate II

Hello,

I'm working on a hobby project where I'm trying to control AC via IR signals controlled through Zigbee and Home Assistant. Thus, I'm working on STM32WB5MM-DK, currently experiencing with the zigbee part of the project as the other parts of the project are already functional.

I'm using STM32Cube of course and first tried -- successfully -- to join my Home Assistant zigbee network, this part is working correctly. The fact is that I now want to be able to store the network parameters and then rejoin it after a reboot or reset of the STM32. Good news is that there is a solution: Persistent storage as described in AN5492.

I read the AN5492 and the Zigbee_OnOff_Router_NVM example. My current code is globally a copy/paste of the Zigbee_OnOff_Router_NVM example with one GPIO control in the On/Off callback. The clusters I'm using are Commissioning (Server) and On/Off (Server), both on the same endpoint. While I can still join my network if the NVM is cleared from any Zigbee-related value, once the connection is successful, if I reboot the device, the STM32 can successfuly connect but is only controlable via Zigbee for a short time: Especially between two persistency callback call (see below):

HardWins_0-1727628900060.png

As you can see on this picture, the Zigbee commands On/Off are successful between the two notifications but once the second on is called, it stops responding to any command...

As I didn't read anywhere about a blocking call and the code has no such call, I'm asking for help !

I'm using Zigbee FFD FW V1.19.1 on STM32WB5MMG (STM32WB5MM-DK). The persistency is done exactly like the example, using EEPROM Emulation.

 

I can share my code without problem if needed, the main code I have changed is app_zigbee.c, attached to this post

 

Thank you for reading, and helping !

16 REPLIES 16

Hello, and thank you for your quick feedback !

Thank you for the updated file. I still have the issue even with the endDeviceTimeout set to 0xFF. Also, the second callback appears ~10s after the first one if this can help to identify the issue.

Tried with an older Zigbee FW, issue still there.

Regards

Hello,

As I'm still facing the issue and still stuck on this point (which make Zigbee platform unusable for me), I'm sharing my full Cube project if it can help.

Regards

 

Hi @HardWins ,

Please find below an update of your app_zigbee.c file modified with the right config capabilities to enable Rx ON IDLE allowing to receive ON/OFF Command from the Client.

The application has been tested with a WB Nucleo coordinator and it is working as expected.

Regards,

Ouadi 

kamranhaider
Associate

Hey @HardWins and @Ouadi,

I've been following your discussion, and it seems like the sleep mode issue is the main hurdle here, even with sleep mode turned off in CubeMX. I understand that a workaround is being tested, and a fix will come in a future release.

In the meantime, one thing you could try is to monitor the power management module more closely and check if any other subsystems are influencing the device's sleep behavior. Additionally, tweaking the polling intervals or keeping the device awake for a longer duration might help as a temporary solution.

Would love to hear how the updated file performs in your testing!

HardWins
Associate II

Hey @Ouadi , @kamranhaider ,

I tested your solution successfully !

You were right, RX IDLE was probably the issue. I had to remove/re-add the device to home assistant for the changes to take effect (which honestly is still a little bit strange but well...)

Kudos to you and your teams and many thanks for the help you're providing to the community !

Hi @HardWins,

From the logs, your device is restarted from persistence, have you erased completely the chip before flashing the new binary with the updated file I provided ? Otherwise, you will restart the device from persistence and the new configuration will not be enabled. 

You need to do a factory reset and perform a new join with your Home Assistant and then try to send commands. 

Can you please give it a try and update the status ? If it still failing, a new PCAP capture would be appreciated!

Best regards,

Ouadi

You are right and that explains why I had to remove then re-add the device to home assistant.

 

I updated my comment probably when you sent the response so, again, thank you for your strong support !

I will probably take the opportunity to create an article on the whole subject to give a typical use case of the stm32wb with Zigbee connectivity once my project is completed.