We have been having some difficult to repeat joining issues for a long time now and these have remained unresolved.
Our experience is our End device will announce itself but will not continue with the establishment process.
We have traced it down to the ZDO_STATE_CHANGE_IND message from the ZNP, which can sometimes return a state of 0.
When this happens the ZNP no longer responds as the SRDY single line remains active low.
After more further debugging we have found that the memory allocation function osal_msg_allocate() for small blocks sizes takes too long complete so the ZNP hangs up and doesn't send it's last byte through so it becomes 0 (DEV_HOLD) rather than DEV_NWK_ORPHAN or DEV_END_DEVICE.
For the message ZDO_STATE_CHANGE_IND the ZAP tries to allocate 16 bytes of RAM on the heap and this can take too long. If we increase it by just one byte it will allocate the RAM from the large block which is much faster. With our testing we have found the this always works.
We are looking for the correct solution which we think will be to increase the timeout in the ZNP.
Where do we do this?
What time should it be?
Note we tried making this section of code critical but there was no change.
Also the time issue is between reading the Frame Header and reading the message byte which is the state.
The function at issue is void zapPhySpiPoll(uint8 port) found in zap_phy_spi.c
Thanks