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

Better treatment of invalid commands --> decreasing risk of getting stuck in the bootloader #37

Merged
merged 1 commit into from
Dec 30, 2024

Conversation

NightHawk32
Copy link
Contributor

Especially when using DShot bidir I found the following scenario happening sometimes:

  • Pulling the signal line high (due to passthrough) --> ESC jumps to bootloader
  • Reading and changing settings works fine
  • switching to "normal" operation with the flight controller sending DSHot commands --> ESC is stuck

The bootloaders sometimes picks up DShot Bidir commands up as commands 0xFF ("CMD_SET_ADDRESS"). With invalid CRC of course. But nevertheless invalid command is never increased (since 0xFF is a valid command) and the ESC is stuck in the bootloader.

Solution:
So when we increase invalid_command whenevver we have bad CRC or unknown commands, we reduce the risk of being stuck in the bootloader and waiting for commands. As soon as we receive a valid command we set invalid_command to 0.

Copy link
Member

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems sensible to me - @AlkaMotors ?

@tridge
Copy link
Member

tridge commented Dec 30, 2024

@NightHawk32 what FC are you using? Is this betaflight? ArduPilot? PX4?

@NightHawk32
Copy link
Contributor Author

@tridge tested with rotorflight and betaflight

@tridge tridge merged commit 167d5b4 into am32-firmware:master Dec 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants