Working on a zephyr/zigbee/802.15.4 system and my code (loosely based on the Nordic samples) on a custom device was not behaving as expected.
So I broke out an nRF5340 DK, built and flashed the standard nrf/samples/zigbee/network_coordinator... Hmmm, nothing good there either, LED flashes forever, nothing else.
After managing to get some logging enabled, and peppering the codebase with crumbs I finally came to the attached trace (I added the 10 second delay at the start of main, just to have time to get all the logs, last line is where the hang is).
Short version: after calling zigbee_enable() execution eventually winds its way down to a call to zb_trans_transmit(), which lives in zigbee/osif/zb_nrf_transceiver.c, and then it's stuck there for all time.
In that function, it's getting caught on whatever radio_api->tx() is and just hanging indefinitely, specifically here:
switch (wait_type) {
case ZB_MAC_TX_WAIT_CSMACA: {
state_cache.radio_state = RADIO_802154_STATE_TRANSMIT;
enum ieee802154_tx_mode mode;
LOG_DBG("%s ZB_MAC_TX_WAIT_CSMACA", __func__);
if (radio_api->get_capabilities(radio_dev)
& IEEE802154_HW_CSMA) {
mode = IEEE802154_TX_MODE_CSMA_CA;
} else {
mode = IEEE802154_TX_MODE_CCA;
}
LOG_DBG("%s got caps mode %i. Calling radio_api->tx()...", __func__, mode);
err = radio_api->tx(radio_dev, mode, pkt, &frag);
LOG_DBG("%s tx called, ret %i", __func__, err);
break;
}
/* ... */
}I am at a loss as to how to move forward at this point.
I am building this with a pretty standard call to
west build -p auto \
-b nrf5340dk_nrf5340_cpuapp \
nrf/samples/zigbee/network_coordinator
and flashing it as per the usual (directly through the DK, or using a j-link for my boards).
I think the zboss stuff is closed source, or at least distributed as some binary blob (ugh), so I'm not sure how to get further toward resolving this.
Any ideas how to resolve or at least debug further?
