Skip to content
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

FIX: Crash after ST24/16 power down PX4#13265 #13266

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ultrasystem
Copy link
Contributor

reset _decode_state and _rxlen after RC data read

reset _decode_state and _rxlen after RC data read
export the function
BUG: when close the ST24/16 controller power , rcinput will switch that receiver type, but in st24.c two variable is not reset
1. _decode_state
2. _rxlen

And the SR24 receiver will keep outputting RC data. That maybe overflow RCInput::work_s and system will crash because kwork_queue used invalid dq.BLINK or FLINK pointers

How to FIX:
reset _decode_state and _rxlen after RC data read
@ultrasystem ultrasystem deleted the patch-4 branch October 25, 2019 08:32
@julianoes
Copy link
Contributor

Hi @ultrasystem, why did you close this again?

@tonirosendahl
Copy link

tonirosendahl commented Nov 9, 2019

Hi, @julianoes and @ultrasystem, I think I was able to reproduce this on V1.10.0-beta1, running on stock Yuneec Typhoon H 480 (ST16 transmitter, SR24 receiver) with custom board definitions (based on Omnibus F4SD) and a customized bootloader. When the ST16 is powered down or the control link is disconnected otherwise, random crashy things happen, like communication timeout to QGroundcontrol with a complete system freeze, Gyro0/Accelerometer0/Magnetometer0 timeout, motor shutdown etc.

@tonirosendahl
Copy link

tonirosendahl commented Nov 9, 2019

The st24_reset() called from RCInput.cpp line 501 as proposed in this pull request, seems to fix the crashes when the ST16 is powered off, but at least for me, when the transmitter is on, it causes constant switching between manual control lost - regained - failsafe enabled.

image

@tonirosendahl
Copy link

tonirosendahl commented Nov 9, 2019

The st24_reset(); seems to fix the issue and work properly when called at line 530 of RCInput.cpp. The FC does not crash when transmitter is powered off, the failsafe mode is enabled properly, and it seems to fly OK too, at least during my short two test flights indoors.

st24_reset();
// Scan the next protocol
set_rc_scan_state(RC_SCAN_SUMD);

@julianoes
Copy link
Contributor

@tonirosendahl ok, can you make a pull request for the fix that you're suggesting?

@ultrasystem
Copy link
Contributor Author

Hi @ultrasystem, why did you close this again?

Some people don't allow me to publish this fix publicly, but fortunately, as @tonirosendahl said, st24_reset can be used to resolve this bug before the DSM state transition.

@ultrasystem ultrasystem restored the patch-4 branch November 11, 2019 13:21
@ultrasystem ultrasystem reopened this Nov 11, 2019
@julianoes
Copy link
Contributor

Some people don't allow me to publish this fix publicly

That would be sad. It's just a bugfix right, not a proprietary super feature 😄?

@JoshG20
Copy link

JoshG20 commented Feb 8, 2020

Can someone check up on this pull request? it seems to have errors, but if its not too hard to fix it would be great to get this in master.

@stale
Copy link

stale bot commented May 13, 2020

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

@stale stale bot added the stale label May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants