[Avrora] CC2420 / Medium lock to transmission
rodolfo de paz
rodolfo.depaz at cit.ie
Mon Jan 11 11:34:36 PST 2010
Although it has passed some time without using Avrora I will try to help
a on this issue.
I noticed that PacketMonitor sometimes does not dump a received packet
although it is received by the node since the node sends an ACK and
resends the packet later on. So I started debugging :)
The problem is the "lock to transmission" in Medium. The receiver is
considered as locked as long as a transmission is found. So, if there
are overlapping transmissions the receiver is locked for a long time.
CC2420Radio relies on this locking detection - which is wrong in my
opinion. According to the CC2420 state machine (see data sheet) the
state changes to RX_WAIT and the back to RX_SFD_SEARCH immediately after
the reception of a frame. (BTW: Has anyone figured out how long the FSM
stays in RX_WAIT???). This is completely independent of the Medium lock!
Yes, you are right saying that it should be in RX_WAIT and then search
for new SFDs without being locked onto the last transmission. When I
started the implementation, there was the idea of having both CC2420 and
CC1000 sharing the same medium. The transmission lock implementation was
already there and was also used for cc220. However, I personally
experienced that the fact of using same medium seems to lead to some
difficulties since the CC2420 is packet-level while the CC1000 is
byte-level and also different state machines are defined on the data
This error does not only affect the monitor, it also delays the sending
of ACKs. Also, some packets might not be received if they follow
I would try to fix it but the overall logic is a bit mystic :) Is it
still necessary to call nextByte() in Medium.Receiver.endReceive()? My
plan is to call endReceive() at certain place in the CC2420 state
machine, which is in nextByte(), but then we will have calls like:
nextByte() -> endReceive() -> nextByte()...
As far as I remember nextByte() is called in the receiver after ending
the reception to flush the FIFO if the transmission was ended at the
middle, send an ACK or simply go to RX_SFD_SCAN.
I guess that the easy patch is to create a function that puts state =
RECV_SFD_SCAN inside the cc2420 implementation when this situation
happens. But be aware that you should flush the FIFO if the transmission
was ended at the middle. So the approach you are suggesting seems to be
right for me. Feel free to ask if you have any other doubts.
Hope this helps,
More information about the Avrora