betaflight / betaflight

Open Source Flight Controller Firmware
GNU General Public License v3.0
8.51k stars 3.01k forks source link

Betaflight does not recognize failsafe event SBUS #12025

Closed kolins-cz closed 1 year ago

kolins-cz commented 1 year ago

Describe the bug

When I turn off radio, fail-safe is not recognized. Only throttle channel drops to 885, rest of channels stays at last value.

I have also tried to short-circuit SBUS to GND. Same, no fail-safe event triggered.

Oscilloscope shows nice 3.3V SBUS signal with sharp edges - no HW issue. Logic analyzer with SBUS decoder plugin shows correct Fail-Safe flag triggered when link is lost as seen on screenshot when radio is off.

image

To Reproduce

Connect SBUS to FC, check normal function Turn off radio, observe parachute in Configurator - no fail-safe event

Expected behavior

Expected behaviour is when firmware reads fail-safe bit in SBUS frame and trigger fail-safe mechanism when 1

Diff configuration

# diff

# version
# Betaflight / STM32F411 (S411) 4.3.2 Nov 28 2022 / 07:27:10 (60c9521) MSP API: 1.44
# config: manufacturer_id: DIAT, board_name: MAMBAF411, version: 6ca1b9ac, date: 2022-11-13T23:31:17Z

# start the command batch
batch start

board_name MAMBAF411
manufacturer_id DIAT

# feature
feature -RX_PARALLEL_PWM

# master
set gyro_1_align_yaw = 1800

profile 0

rateprofile 0

# end the command batch
batch end

Resources configuration

resource show all
Currently active IO resource assignments:
(reboot to update)
--------------------
A00: ADC_BATT
A01: ADC_CURR
A02: FREE
A03: FREE
A04: GYRO_CS 1
A05: SPI_SCK 1
A06: SPI_MISO 1
A07: SPI_MOSI 1
A08: FREE
A09: FREE
A10: SERIAL_RX 1
A11: USB
A12: USB
A13: SWD
A14: SWD
A15: FREE
B00: GYRO_EXTI
B01: FREE
B02: BEEPER
B03: MOTOR 1
B04: MOTOR 2
B05: FREE
B06: MOTOR 3
B07: MOTOR 4
B08: FREE
B09: FREE
B10: INVERTER 1
B11: FREE
B12: OSD_CS
B13: SPI_SCK 2
B14: SPI_MISO 2
B15: SPI_MOSI 2
C00: FREE
C01: FREE
C02: FREE
C03: FREE
C04: FREE
C05: FREE
C06: FREE
C07: FREE
C08: FREE
C09: FREE
C10: FREE
C11: FREE
C12: FREE
C13: LED 1
C14: LED 2
C15: FREE
D00: FREE
D01: FREE
D02: FREE
D03: FREE
D04: FREE
D05: FREE
D06: FREE
D07: FREE
D08: FREE
D09: FREE
D10: FREE
D11: FREE
D12: FREE
D13: FREE
D14: FREE
D15: FREE
E00: FREE
E01: FREE
E02: FREE
E03: FREE
E04: FREE
E05: FREE
E06: FREE
E07: FREE
E08: FREE
E09: FREE
E10: FREE
E11: FREE
E12: FREE
E13: FREE
E14: FREE
E15: FREE

Currently active Timers:
-----------------------
TIM1: FREE
TIM2:
    CH2 : MOTOR 1
TIM3:
    CH1 : MOTOR 2
TIM4:
    CH1 : MOTOR 3
    CH2 : MOTOR 4
TIM5: FREE
TIM6: FREE
TIM7: FREE
TIM9: FREE
TIM10: FREE
TIM11: FREE

Currently active DMA:
--------------------
DMA1 Stream 0: FREE
DMA1 Stream 1: FREE
DMA1 Stream 2: TIMUP 3
DMA1 Stream 3: SPI_MISO 2
DMA1 Stream 4: SPI_MOSI 2
DMA1 Stream 5: FREE
DMA1 Stream 6: TIMUP 4
DMA1 Stream 7: TIMUP 2
DMA2 Stream 0: SPI_MISO 1
DMA2 Stream 1: FREE
DMA2 Stream 2: FREE
DMA2 Stream 3: SPI_MOSI 1
DMA2 Stream 4: ADC 1
DMA2 Stream 5: FREE
DMA2 Stream 6: FREE
DMA2 Stream 7: FREE

#

Flight controller

Mamba F411 25A AIO

Other components

Frsky R-SXR over SBUS (unknown exact version, LBT firmware) Radiomaster TX16s with latest OpenTX, Multimodule latest

How are the different components wired up

No response

Add any other context about the problem that you think might be relevant here

Tested with 4.3.2, latest development build, old 4.1.4

kolins-cz commented 1 year ago

Solved. After studying Betaflight source code I have seen that failsafe bit in SBUS frame is indeed handled. Bug is in Betaflight Configurator after all. image