Hi, I'm trying to track down an intermittent reboot in our product. Our product uses a CC2652R and is using the Zigbee stack in SimpleLink version 4.20.1.0. Our application is fairly sizable and unfortunately I can't really provide a minimal code example that reproduces the issue that I'm seeing. But I can tell you the sequence of function calls that I think lead to the reboot.
The scenario where we're seeing the reboot is when trying to change the Zigbee channel on our device. Our system carries out various actions in response to incoming commands over Zigbee. I have been able to pare down our command handlers to the bare minimum code that will reproduce the issue that we're seeing. My test script sends down two Zigbee commands in a loop.
The first command handler just saves the received Zigbee channel mask to NV storage and tells the stack to reset the network settings on the next boot by calling the following lines of code:
zclport_writeNV(NV_USER_CHANNEL, 0, sizeof(mask), &mask);
zgWriteStartupOptions(ZG_STARTUP_SET, ZCD_STARTOPT_DEFAULT_NETWORK_STATE);
The second command handler just reboots the device by calling the following line of code:
SysCtrlSystemReset();
When the device boots back up, it reads the saved Zigbee channel mask from NV storage and initializes the stack via a call to Zstackapi_sysConfigWriteReq().
As I said, the test script just sends these two Zigbee commands down in a loop, passing down a new channel on each iteration. I can usually run this loop a few dozen times with no incident but intermittently, the device reboots when the first command is sent down. (Yes, the second command would have rebooted the unit anyway but remember, this is a minimal example to reproduce the problem. In our actual application, there are other actions that need to take place between those two commands.)
Note that I'm using the watchdog API in SimpleLink so the fact that the system is rebooting is very possibly a watchdog reset because something is hanging. I've got a fairly long watchdog timeout, 45 seconds, so I doubt it's simply a case of some command taking too long to complete.
The interesting part of this problem is that if I take the second command out of our test suite, ie, we're just looping on the command that calls zclport_writeNV() and zgWriteStartupOptions(), then I can't reproduce the issue. So it seems to only manifest if I call zclport_writeNV() and zgWriteStartupOptions() and follow it up with a call to SysCtrlSystemReset().
Are there any known issues with zclport_writeNV() or zgWriteStartupOptions() that could lead to a reboot or hang? From what I can tell, zgWriteStartupOptions() also basically boils down to a NV write. In particular, is there anything that might also involve SysCtrlSystemReset()?
Thanks in advance,
Grant China
WattIQ, Inc.