Repository navigation
Separate FIFO locations for TX & RX on SX1280 - #3620
Conversation
|
At the request of @pkendall64 after chatting in the ELRS Discord #mavlink-rc channel I tested with stock ELRS v4.0 for about 30 min on the bench with multiple channel low (881us) events, then flashed this PR and tested on the bench for about 20 min with no occurrences of the channel low (881us) events, which suggests that the fix applied resolves the issue. |
|
Thanks @d-papworth |
CapnBry
left a comment
There was a problem hiding this comment.
I may have come for the FIFO buffer segmentation but I really think the verification but the verification of the chipStatus is an even stronger fix. I believe that also would have solved the old issue where we were getting too many interrupts per period and faux-advancing the nonce
CapnBry
left a comment
There was a problem hiding this comment.
Thanks! Incredible work finding this, it is amazing we've never seen this in testing, and thanks @d-papworth for reporting with all the details.
mha1
left a comment
There was a problem hiding this comment.
6h run yesterday on a SX1280/SX1280 setup woth no obvious issues.


Problem
On SX1280 receivers, the radio driver was using the same internal packet buffer region for both transmit and receive operations. Under rare conditions this could allow a just-transmitted telemetry payload, such as an OTA LinkStats packet, to be read back through the receive path and misinterpreted as RC data. Because LinkStats and RC packets share the same OTA packet type value; when in MAVLink mode, this could appear on the flight controller as a bogus
RC_CHANNELS_OVERRIDEframe and would cause a disarm of the craft if using channel-based arming.Solution
The SX1280 driver now uses separate FIFO base addresses for transmit and receive. This prevents transmitted telemetry data from being re-read through the RX path and removes the buffer aliasing condition that could cause LinkStats payloads to be decoded as RC data.
Belt-and-braces
As an additional safeguard, the RX path also validates the radio status returned by
GET_RXBUFFERSTATUSbefore reading packet data. The driver only accepts a received packet if the chip reports that it is in RX mode and that data is available for reading.