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

ChibiOS: enable UART FIFO on H7 and G4 by default #17959

Merged
merged 5 commits into from Jul 15, 2021

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Jul 7, 2021

This enables the hardware FIFO on UARTs on G4 and H7 by default. It can be disabled using a SERIALn_OPTIONS bit.
Enabling the fifo makes it possible to do very high baudrates without DMA. Testing on a CubeOrange shows no byte loss at 2MBit/s between telem1 and telem2 without DMA and with the FIFO enabled.
This makes moving baseline dual GPS yaw more reliable on H7 as it removes DMA issues for the RTCM data on H7 based boards. Testing with two F9P u-blox modules shows reliable yaw with DMA disabled on both ports. Disabling DMA actually helps as it stops contention with other devices on the same DMA channels, lowering latency for the RTCM data.
Setting SERIALn_OPTIONS to 768 disables DMA in both directions, which works very well for GPS yaw

@tridge tridge added the ChibiOS label Jul 7, 2021
@github-actions
Copy link

github-actions bot commented Jul 7, 2021

Heads up @bugobliterator - the "ChibiOS" label was applied to this issue.

@amilcarlucas
Copy link
Contributor

Does this bypass the ring-buffer and writes directly to the UART hardware FIFO?

@tridge
Copy link
Contributor Author

tridge commented Jul 9, 2021

Does this bypass the ring-buffer and writes directly to the UART hardware FIFO?

no, ring buffer is still there. The big advantage is for receive with no DMA, where we become much less sensitive to interrupt latency and so can receive high baudrates with no loss of bytes without using DMA

@rmackay9
Copy link
Contributor

Two experienced beta testers (Yuri and Kenny) have offered to test this over the next week or so. See discussion here.

@yuri-rage
Copy link
Contributor

Two experienced beta testers (Yuri and Kenny) have offered to test this over the next week or so. See discussion here.

I started testing today and noticed no real improvement so far. Autopilot-in-the-middle communication between moving base and rover has never been very reliable for me (Cube Orange, SERIAL3 and SERIAL4). I'm open to any suggestions for parameter changes beyond those described in the discussion that Randy linked. I can provide logs for any tested configuration.

@tridge
Copy link
Contributor Author

tridge commented Jul 13, 2021

I can provide logs for any tested configuration.

I'd like the log for both GPS ports set to 768 options for no DMA, thanks!

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

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

This has been tested by Yuri the rover user so I'm approving, thanks!

@tridge tridge merged commit db1df9d into ArduPilot:master Jul 15, 2021
@rmackay9 rmackay9 added this to pending in Copter 4.1 Jul 22, 2021
@tridge tridge moved this from pending to 4.1.0-beta6 in Copter 4.1 Jul 22, 2021
@tridge tridge added this to Done in Plane 4.1 Jul 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Copter 4.1
4.1.0-beta6
Rover 4.1
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

5 participants