Skip to content

[4.5.1] Fixes #13664 - Smartaudio don't work with Softserial (#13715) #13734

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

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

haslinghuis
Copy link
Member

…light#13715)

Fixing issue betaflight#13664
Softserial port option has changed from 4.4.x to 4.5.0. By this the Smartaudio line is in an unknown voltage state while not TX is running - this violates the Smartaudio standard. vtx_softserial_alt should be set to OFF to use Smartaudio.
Copy link

Do you want to test this code? You can flash it directly from Betaflight Configurator:

  • Simply put #13734 (this pull request number) in the Select commit field of the Configurator firmware flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

nerdCopter
nerdCopter previously approved these changes Jun 27, 2024
@@ -707,7 +707,7 @@ bool vtxSmartAudioInit(void)
// the SA protocol instead requires pulldowns, and therefore uses SERIAL_BIDIR_PP_PD instead of SERIAL_BIDIR_PP
const serialPortConfig_t *portConfig = findSerialPortConfig(FUNCTION_VTX_SMARTAUDIO);
if (portConfig) {
portOptions_e portOptions = SERIAL_STOPBITS_2 | SERIAL_BIDIR | SERIAL_BIDIR_PP_PD;
portOptions_e portOptions = SERIAL_STOPBITS_2 | SERIAL_BIDIR | SERIAL_BIDIR_PP_PD | SERIAL_BIDIR_NOPULL;
Copy link
Member

Choose a reason for hiding this comment

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

I don’t believe you need SERIAL_BIDIR_PP_PD. See

const uint8_t pinConfig = (softSerial->port.options & SERIAL_BIDIR_NOPULL) ? IOCFG_AF_PP : IOCFG_AF_PP_PD;

Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need it for softserial. But UART drivers use it to select GPIO_MODE_AF_PP / GPIO_MODE_AF_OD and smartaudio won't work with OD

Copy link
Member Author

Choose a reason for hiding this comment

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

Do I need to drop commit 2 or is it okay @ledvinap

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that it won't work on UART without SERIAL_BIDIR_PP_PD. In this PR, I'd return it, to keep changes to minimum (UART driver does not test SERIAL_BIDIR_NOPULL)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree - dropped commit 2 - this is a cherry-pick after all

nerdCopter
nerdCopter previously approved these changes Jun 28, 2024
@blckmn blckmn merged commit ec8c59b into betaflight:4.5-maintenance Jun 28, 2024
23 checks passed
@haslinghuis haslinghuis deleted the fix-sass branch June 28, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants