ArduPilot Pull Request flash size check

As ArduPilot gains new features and drivers the overall code size (aka “flash”) naturally increases. We’ve reached the point where we need to check each Pull Request (aka PR) to be sure that it doesn’t overflow beyond what will actually fit onto some representative boards. To make this easy we’ve enhanced our “autotests” (aka “CI”) so that it does this comparison automatically for each PR.

Below are two screenshots showing how you can view the change in flash size using my Gremsy PR as an example.


Of course if you do find your PR consumes significant amounts of flash (e.g. more than a few hundred bytes) then some additional code changes may be required. Normally this involves adding additional definitions (e.g. #ifdef !HAL_MINIMIZE_FEATURES) to ensure the feature is only included for boards with sufficient flash space but it may also involve “chunkifying” the library involved so that individual drivers can be enabled/disabled and then allow users to select exactly which drivers they need using the custom build server. Here is an example PR that does this.

One of the core principals of AP is that we support a wide variety of flight controllers and sensors and we expect through the “chunkification” work on the libraries we can keep supporting even the older smaller boards for some time to come.

8 Likes