Closed no2chem closed 2 months ago
Debugging into this more, it looks like the problem is we get a IEEE802154_RX_ABORT_BY_RX_RESTART
when we are in state IEEE802154_STATE_TX_ACK
. Perhaps because the RX gets aborted in ieee802154_transmit
, but we are handling event TX_SFD_DONE
still (due to the OPENTHREAD_CONFIG_TIME_SYNC_ENABLE
).
So it appears that we end up in this state in error actually because of CslTransmit
.
Specifically, it looks like in time sync messages a delay is set:
aFrame->mInfo.mTxInfo.mTxDelay != 0
,
so we use the transmit_at function - esp_ieee802154_transmit_at
.
I think when the delay is large enough (in a time sync message, perhaps), there is some interaction that causes a RX abort in a TX state.
Okay - I think I've isolated the issue but I'm not sure what the fix is yet.
It looks like when ieee802154_transmit_at
, the RX state isn't checked. So if the timer expires while we were in the middle of doing a RX, we'll get an RX abort but that will get picked up after the state has been transitioned to TX_ACK.
Hi, @no2chem , thanks for your so detailed analysis! I will try to reproduce this issue and fix it later.
Hi @zwx1995esp - I'm not sure if you've made progress on this, but it seems like when isr_handle_rx_abort
is hit, ieee802154_timer0_get_value()
will return a value. So for some reason RX is still happening when the timer is loaded. There's not much documentation on the ieee820154 driver but I think we need to make sure no other operation takes place until the timer resets.
@zwx1995esp adding further to this, it does seem to go away if I disable RX_WHEN_IDLE, however, that is not very useful as any router will need to rx when idle in order to talk to children. I can't tell if its just RX_WHEN_IDLE causing the problem, or if turning off RX_WHEN_IDLE just reduced the amount of RXes.
Hi, @no2chem I have already add this issue in my todo list, but sorry, a little busy these days(I worked on C5 IEEE802154 feature supporting these days), I think I will start this issue next week.
Thanks! I see, I think I fixed the issue, will submit a PR shortly. edit: never mind, seems to still happen, still looking into it
Ok, welcome for PRs :) if you fix it.
Hi @zwx1995esp - I submitted a PR which seems to address my issues. https://github.com/espressif/esp-idf/pull/14089
As I don't have any documentation on the 802.15.4 hardware, please check to see if my edits make sense.
Thanks!
@no2chem see https://github.com/espressif/esp-idf/pull/14089#issuecomment-2264960998, could you please test with the latest IDF master branch, and let us know if you see any further issues.
Answers checklist.
IDF version.
v5.4-dev-826-g8760e6d2a7
Espressif SoC revision.
esp32h2-20221101
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
esp32-h2-devboard-m
Power Supply used.
USB
What is the expected behavior?
It should not assert and send the frame with ie fields properly
What is the actual behavior?
An assert in
isr_handle_rx_abort
,IEEE802154_ASSERT(s_ieee802154_state == IEEE802154_STATE_RX);
is hit.Steps to reproduce.
Debug Logs.
More Information.
No response