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

G4 LPUART rework #11821

Merged
merged 2 commits into from Jun 15, 2023
Merged

Conversation

DieHertz
Copy link
Member

@DieHertz DieHertz commented Sep 2, 2022

This PR contains changes from #11786 as it's somewhat related (touches the same places), I will remove them once it's merged.

Substantial changes are the ones related to UART DMA and IRQHandlers:

  • there were no IRQHandlers defined for UART10 and LPUART1.
  • static uartDmaopt_t uartDmaopt[] had no entry for LPUART1
  • UARTDEV_CONFIG_MAX = 8 did not take neither UART10 nor LPUART1 into account

Tested on my G4 board made by Airbot

@blckmn
Copy link
Member

blckmn commented Sep 2, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> PASS
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> PASS
  • assigned to an approver -> FAIL
  • approver count at least three -> PASS

src/main/io/serial.h Show resolved Hide resolved
src/main/io/serial.h Show resolved Hide resolved
@DieHertz
Copy link
Member Author

DieHertz commented Sep 4, 2022

@haslinghuis both LPUARTDEV_1 and SERIAL_PORT_LPUART1 are target-agnostic and therefore defined for all targets, not sure what you're asking to change here.

@DieHertz
Copy link
Member Author

DieHertz commented Sep 4, 2022

The build fails here: https://github.com/betaflight/betaflight/runs/8152581016?check_suite_focus=true and here: https://github.com/betaflight/betaflight/runs/8152581665?check_suite_focus=true

I'm waiting for the other PR to get merged before any fixes in this one anyway

It fails for a different reason, looks like the file which includes and uses this Macro does not include serial_uart.h. It would fail on a UARTDEV_1 as well.

@haslinghuis haslinghuis added this to the 4.4 milestone Sep 23, 2022
@haslinghuis haslinghuis moved this from Firmware to Needs work in Finalizing Firmware 4.4 Release Sep 30, 2022
@haslinghuis haslinghuis moved this from Needs work to Inactive in Finalizing Firmware 4.4 Release Nov 12, 2022
@x4FF3
Copy link
Contributor

x4FF3 commented Dec 1, 2022

Hi,

would be great if this could be merged :)

@haslinghuis
Copy link
Member

haslinghuis commented Dec 1, 2022

Besides rebase build is failing so needs some work after merge of #11786

G4 samples are on their way for development.

@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member

@DieHertz hope you don't mind. Have rebased this work and fixed the macro for non LPUART boards

@github-actions

This comment has been minimized.

@haslinghuis haslinghuis moved this from In progress to To do in Finalizing Firmware 4.4 Release Jan 18, 2023
@haslinghuis
Copy link
Member

LPUART is showing but SOFTSERIAL not.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

Do you want to test this code? Here you have an automated build:
Assets
WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!

@haslinghuis
Copy link
Member

haslinghuis commented Apr 20, 2023

For 4.4 we need: betaflight/unified-targets#989
For 4.5 we need: #12705

Copy link
Member

@SteveCEvans SteveCEvans left a comment

Choose a reason for hiding this comment

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

I'll review in more details once #11786 is merged and this is rebased.

@@ -4931,6 +4931,10 @@ const cliResourceValue_t resourceTable[] = {
#ifdef USE_INVERTER
DEFA( OWNER_INVERTER, PG_SERIAL_PIN_CONFIG, serialPinConfig_t, ioTagInverter[0], SERIAL_PORT_MAX_INDEX ),
#endif
#if defined(USE_SOFTSERIAL1) || defined(USE_SOFTSERIAL2)
Copy link
Member

Choose a reason for hiding this comment

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

@sugaarK
Copy link
Member

sugaarK commented Jun 1, 2023

and this

Copy link
Member

@sugaarK sugaarK left a comment

Choose a reason for hiding this comment

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

Tested on my new g4 airbot aio works good

Copy link
Member

@sugaarK sugaarK left a comment

Choose a reason for hiding this comment

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

Tested on my new g4 airbot aio works good

@haslinghuis
Copy link
Member

This PR contains changes from #11786 as it's somewhat related (touches the same places), I will remove them once it's merged.

@KarateBrot @SteveCEvans please review #11786

@haslinghuis haslinghuis merged commit b8855d3 into betaflight:master Jun 15, 2023
18 checks passed
@ctzsnooze
Copy link
Member

ctzsnooze commented Jun 20, 2023

Softserial users who upgrade firmware from versions before this PR, and who restore their previous settings by diff or preset->save/restore, will find that they lose soft serial.

If soft serial was previously configured to serial TX 11, an older diff would include a line in the form:

resource SERIAL_TX 11 Ann

Where Ann means the pin designator, eg something like resource SERIAL_TX 11 B01

After this PR, this line should be reverted with

resource SERIAL_TX 11 NONE

And a line should be added, in the form:

resource SOFTSERIAL_TX 1 Ann

but with the same pin designator as before, eg resource SOFTSERIAL_TX 1 B01

@haslinghuis
Copy link
Member

@ctzsnooze this has nothing to do with this PR.

Rename was done in #12679 but only applies to config.h. Before that it was changed from SERIAL to UART.

@ctzsnooze
Copy link
Member

Sorry.
It was #11786 that caused the problem for me.
It only happened in the last few days, and #11786 was merged two days ago.

davidbitton pushed a commit to davidbitton/betaflight that referenced this pull request Feb 5, 2024
* Extracted SOTSERIAL_TX & RX resources

* Fixed LPUART1 on G4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

None yet

7 participants