-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/cc2538: wait for ongoing transmission before flushing TX FIFO #5725
Conversation
Can't test before next week |
Hi, i've tested with this:
Now the cc2538 sends the first TX frame, but the second one is not sent. tcpdump output:
|
Hi @LucaZulberti, two things:
In my tests, the ICMP response packets are in fact being sent/received correctly from/by the CC2538. I can see all packets using an external sniffer, as well as by using debug output on the CC2538. I can also ping between two CC2538 nodes successfully, using the same size payload (120). So I can only conclude that the at86rf230 driver is not processing the second packet of the ICMP response correctly, and therefore not registering it as a reply to the ping. Actually, it turns out this is a real Heisenbug - try setting Hope that makes sense. |
Hi @aeneby:
Setting Unfortunately I will not be able to test the patch with another cc2538 board before Semptember. |
Thanks @LucaZulberti - I will have to look into this more closely given your comments. I'm confused as to why it would work between two CC2538 nodes, but not other transceivers. If only I had more hardware to test with... |
I just gave it a quick try. When pinging between a zolertia remote-reva and a samr21-xpro board, timeouts still appeared for greater payloads. Somehow I cannot even ping between two remotes any more :/ ... Don't have time to debug this. Just give me a hint when you need me to test something specific |
c3febd3
to
5f71cc8
Compare
Rebased to master. I'm confused. I can ping happily between cc2538 nodes, with both small and large payloads (up to about 1000 bytes - see below). I can see the OTA traffic with an external sniffer. It looks fine. I really have no clue as to why it shouldn't work for you. I did notice one strange thing, though - RIOT cannot respond to ipv6 pings where the reply requires greater than 9 packets (say, a payload of 1024 bytes). I say "RIOT" here and not "driver" because the problem seems to be further up the network stack - if I enable debug in
One for each packet missing from the reply, which seems to be every packet after the 9th for some reason. This bug is probably unrelated to this PR but I wanted to mention it, in case you are trying to test with payloads that big. |
Which board do you use? |
openmote-cc2538 |
With two remote revision A boards and gnrc_networking I still get big losses for "larger" packets. However, this PR does not make things worse and according to the user guide the delay makes sense to me. Will open a separate issue for the remotes. ACK for this PR. |
Issue is in #5786 |
ACK and go |
Thanks @PeterKietzmann - I'll see if I can replicate the packet loss and report on the newly created issue. |
@PeterKietzmann BTW, did you not encounter the issue with |
@aeneby honestly I didn't test it and I don't find the time currently. The default message queue size is |
For larger packet sizes and/or fast consecutive sends, the mutex lock is not enough to guarantee exclusive TX FIFO access. Since the TX operation is non-blocking, the lock may be released and re-taken again before transmission has completed. Flushing the TX FIFO while a transmission is in progress will result in TX underflow errors and lost packets, so make sure there's no active transmission before we claim it.
Perform the wait here rather than after the send, in case a non-netdev TX operation is in progress (e.g. AUTOACK).