From ffaed18e679e7eb780518d4c2ec42d1f1747d451 Mon Sep 17 00:00:00 2001 From: Michael Schaeuble Date: Tue, 18 Oct 2016 22:40:50 +0200 Subject: [PATCH] Reduce the binary size Bebop The firmware binary is to large to fit into the onboard memory of the Parrot Bebop. It could be uploaded to the emmc, but for ease of use it would be nice to have it in /usr/bin. To strip the binary seems to be the best option right now. --- Tools/adb_upload_to_bebop.sh | 4 ++++ cmake/common/px4_base.cmake | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Tools/adb_upload_to_bebop.sh b/Tools/adb_upload_to_bebop.sh index ca3eb84837..ebf1bfa5e5 100755 --- a/Tools/adb_upload_to_bebop.sh +++ b/Tools/adb_upload_to_bebop.sh @@ -33,6 +33,10 @@ sleep 1 adb shell mount -o remount,rw / adb shell touch /home/root/parameters +${RPI_TOOLCHAIN_DIR}/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-strip \ + -R .comment -R .gnu.version \ + ../build_posix_bebop_default/src/firmware/posix/px4 + ../Tools/adb_upload.sh $@ echo "Disconnecting from bebop" diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake index 6c5f8ad9a6..b471983ab9 100644 --- a/cmake/common/px4_base.cmake +++ b/cmake/common/px4_base.cmake @@ -678,6 +678,8 @@ function(px4_add_common_flags) message(STATUS "address sanitizer enabled") if ("${OS}" STREQUAL "nuttx") set(max_optimization -Os) + elseif (${BOARD} STREQUAL "bebop") + set(max_optimization -Os) endif() # Do not use optimization_flags (without _) as that is already used. @@ -692,6 +694,8 @@ function(px4_add_common_flags) else() if ("${OS}" STREQUAL "nuttx") set(max_optimization -Os) + elseif (${BOARD} STREQUAL "bebop") + set(max_optimization -Os) else() set(max_optimization -O2) endif()