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

FMUv5x/v6x Remove unused sensors, non-inline some functions #23944

Closed
wants to merge 3 commits into from

Conversation

niklaut
Copy link
Contributor

@niklaut niklaut commented Nov 14, 2024

Solved Problem

We want to free 40kB of Flash in FMUv5x and FMUv6x to merge the Rover modules into the default config.

FMUv5x: 1962356 - 2014364 = -52008
FMUv6x: 1891472 - 1932816 = -41344

Solution

We removed sensor drivers of old FMU revisions that were either never shipped to customers or are not actively being flown anymore. For this we queries the Auterion Suite ulogs for the device_ids of all recent flights (~6 months).

In addition, @alexcekay created a tool to find candidate functions for non-inlining. We chose only a few functions for now that we are sure don't increase CPU usage and still free up ~4kB.

Alternatives

We could also try more non-inlining, however, it's way more manual work than removing device drivers.

Test coverage

Only the non-inlining has runtime impact:

  • Saves ~4.4K of FLASH
  • Peak at 64% CPU usage when armed with and without changes
  • uORB top shows same rate for accel and gyro as before

Context

Inline Function Usage Analyzer

@niklaut niklaut requested a review from sfuhrer November 14, 2024 16:22
@niklaut niklaut changed the title Pr v5x v6x remove unused sensors FMUv5x/v6x Remove unused sensors, non-inline some functions Nov 14, 2024
@niklaut
Copy link
Contributor Author

niklaut commented Nov 14, 2024

I may have removed too much for upstream…

@niklaut niklaut closed this Nov 14, 2024
@mrpollo
Copy link
Contributor

mrpollo commented Nov 15, 2024

I may have removed too much for upstream…

Thanks for the effort. However, as you probably noticed, we must continue carrying all the sensor sets published for the FMUv[5-6]X standards.

We are also thinking of flash constraints and will be introducing changes soon; we are likely going to drop the all-inclusive builds in favor of per-vehicle type. Hopefully, the savings will be worth the trouble. See #23901 for more info.

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.

3 participants