11-Dec-2020, 10:30 PM
The following was posted by Tony Cake on the ImmersionRC Hub a few days ago. It looks like this bug has existed in Betaflight pretty much forever. It only affects single-wire bi-directional serial protocols. The fix has already been merged into the Betaflight 4.2.6 release (the pull request is HERE), so if anyone is running one of the affected serial receiver protocols, they will probably want to install that new release as soon as it gets published.
Tony Cake Wrote:Bit of news from the Betaflight side. This past week a fairly serious bug was fixed in the core of the Betaflight serial drivers which potentially affects any single-wire (bidirectional) Rx protocol (including GHST, SRXL-2, and possibly also FPort, and others). Basically any protocol that wires the Rx to the FC using a UART Tx wire, instead of Rx, on F7, F3, G4, H7 based FCs.
The bug manifested itself by causing dropped packets between the Rx and FC, which were not actually dropped on the RF link between Tx and Rx.
Noisy systems, with wiring between Rx and FC which happened to pass close to the inductor of a switching regulator, could experience the problem. This describes most builds unfortunately.
For the technically inquisitive, the bug was caused by a piece of code which erroneously enabled pulldowns for all Bidirectional UARTs. With non-inverted receivers pulling the same line up, the result was a tug of war which would cause the UART line to sit at half of the supply voltage, and be extremely susceptible to noise.
The bug appears to have been introduced back in 2016, so it has been around for a good while.
If you are experiencing higher than expected packet loss, or failsafes, with any single-wire Rx (GHST included) and don't mind testing a development build of Betaflight, it is certainly worth installing.
Many thanks to Alex Kubrak, Gary Kent for relentlessly hounding me, and tracking down every lost packet, until this was discovered.