Crsf radio failsafe - .04s glitch cause land FS to kick in? (4.1 post)

Instancing this topic to 4.1 forum and copying some of the discussion below:

While hover-testing my quad just a few ft away from me, I’ve had a few instances where it would just start descending slowly into the ground.

I managed to get a log from one of these cases and it looks like it’s hitting radio FS -> landing. The FS only lasts 0.04s according to the logs

Firstly, I was under the impression that the failsafe response wouldn’t kick in unless the system was FS for >0.5s. Do I have something set up incorrectly?

Secondly, the radio always showed 100% LQ, RFMD 2 while I’m testing (not surprising since the quad is just 10 ft from me) and I’ve been using this radio on 4 other CRSF quads running Betaflight without ever hitting a FS. Does anyone have suggestions on how to debug this as I’m a bit stumped.

"

“Please can you post in the 4.1 channel? What version of 4.1 are you using? Is your receiver connected to a DMA-enabled UART? What FC do you have? There have been reports of CRSF FS but they have been down to poor UART performance. If there is an issue I am keen to get to the bottom of it.”

My Firmware version below. I’m using a Matek F405-SE. I have Serial RX on UART2. This is an STM F7 uC and I think USART2 supports DMA but DMA is software-configured so how can tell if it’s DMA enabled?

7/24/2021 11:11:55 AM : MatekF405-Win 00560031 55535013 2039305
7/24/2021 11:11:55 AM : ArduCopter V4.1.0-beta4 (37070bfe)

On that board the only UART with full DMA is UART1 == SERIAL3. You can tell by using mavproxy and doing:

ftp get @SYS/uarts.txt -

DMA enabled uarts have a * next to them

This is what I get from mavproxy:

Getting @SYS/uarts.txt as -
UARTV1
SERIAL0 OTG1 TX = 55433 RX = 537 TXBD= 28073 RXBD= 271
SERIAL1 UART1 TX*= 0 RX*= 0 TXBD= 0 RXBD= 0
SERIAL2 EMPTY
SERIAL3 UART3 TX = 0 RX = 0 TXBD= 0 RXBD= 0
SERIAL4 UART4 TX*= 0 RX = 0 TXBD= 0 RXBD= 0
SERIAL5 UART5 TX*= 46 RX = 13446 TXBD= 23 RXBD= 6809
SERIAL6 UART6 TX*= 0 RX = 9 TXBD= 0 RXBD= 4
SERIAL7 UART2 TX = 0 RX = 0 TXBD= 0 RXBD= 0

Should I move the CRSF to a DMA enabled SERIAL/UART? I have my CRSF connected to RX2/TX2. I’m also slightly confused about whether the pin “RX/TX#” refers to the SERIAL# or the UART#. Most of the assignments are 1:1 so it doesn’t matter, except UART2 = SERIAL7 and SERIAL2 = empty?

This is a link to the FC: http://www.mateksys.com/?portfolio=f405-se#tab-id-3

SERIAL refers to the parameters you configure, UART refers to the actual uart - so not very interesting unless you are fiddling with the code, although it may correspond to the board documentation. I think you should try moving to the DMA enabled UART to see if that helps - I have seen other people have better luck with DMA. CRSF is 416kbaud so regular polling is going to struggle.

Alrighty, I’ll give UART4 a try. If this improves, should I ask Matek to update their website to recommend using a DMA UART for Ardupilot? Their current site by default suggests using RX/TX2.

UART4 only has TX - you need both RX and TX - which means UART1

Other option is to use the bdshot target which I think gives UART3 full DMA

I just moved my CRSF to UART4, set up SERIAL4 option to CRSFT, and I’m able to use radio control in the Radio Calibration tab and the CRSF LUA script from the radio. Is there an issue I’m not seeing?

Every UART will work - but this thread was about failsafes - i.e. generally works, but not under some conditions. The theory is that DMA will make failsafes less likely.

Ah, gotcha! For some reason I looked but didn’t see the * next to the RX.

The TX1/RX1 pad on my FC is unfortunately on the bottom and in use, which means I’d have to re-do quite a bit of my quad for it.

If I want to try the bdshot target for USART3, is this the correct one [MatekF405-bdshot]? Is there any thing I need to watch out for if I just save the paramlist from my current target to a file and load it onto this one?

I decided to keep the variables at a minimum, so I’ll move my CRSF to TX1/RX1 (and my DJI to TX/RX2). May be a bit before I get to fly so I’ll report back in a week or two. Thanks!

Yes should work right out of the box

I got a 15 minutes of flight in today and 10 minutes yesterday. I didn’t hit any abrupt landings so it seems like this fixed the issue.

2 Likes

This definitely fixed the issue as I’ve gotten over an hour total of flight time so far without problems.

So as someone who had to crawl through a few different places to piece together how to set up crsf… I feel like I’d want to pay it forward by communicating this somewhere. Does it make sense to ask Matek to update their guidelines to include some setup tips for CRSF?

It’s a bit more involved since this is SW dependent so they can’t just recommend a single UART.

I had a PR that got rejected: https://github.com/ArduPilot/ardupilot/pull/18183

Certainly asking Matek to update their docs makes sense

They’ve update the website

1 Like