Binary Size Profiling
The bloaty_compare_master
build target allows you to get a better understanding of the impact of changes on code size. When it is used, the toolchain downloads the latest successful master build of a particular firmware and compares it to the local build (using the bloaty size profiler for binaries).
:::tip This can help analyse changes that (may) cause px4_fmu-v2_default
to hit the 1MB flash limit. :::
Bloaty must be in your path and found at cmake configure time. The PX4 docker files install bloaty as shown:
The example below shows how you might see the impact of removing the mpu9250 driver from px4_fmu-v2_default
. First it locally sets up a build without the driver:
Then use the make target, specifying the target build to compare (px4_fmu-v2_default
in this case):
This shows that removing mpu9250 from px4_fmu-v2_default
would save 10.3 kB of flash. It also shows the sizes of different pieces of the mpu9250 driver.
Last updated