Cannot build CubeOrange due to flash overflow

Dear all,

I’m trying to build the CubeOrange PX4 from the shell on my Linux PC, following https://docs.px4.io/master/en/flight_controller/cubepilot_cube_orange.html#building-firmware .

While it worked the first time I tried it, I now get a compilation error because the flash space is used up:

/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/…/lib/gcc/arm-none
-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld: cubepilot_cubeorange_default.elf section .text' will not fit in region FLASH’
/opt/gcc-arm-none-eabi-9-2020-q2-update/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld: region `
FLASH’ overflowed by 104481 bytes

This prevails even after a “make distclean”. Any ideas on why this happens or how I can solve it?

Thanks,

Björn

I had the same issue on CubeOrangePlus. It looks to me like there is only 1920kb available for static data (in my case). If the total static data for all the modules exceeds that, the build fails. (Which is nice, it would be worse to have the build succeed and then proceed with a truncated data section).

I fixed it by deselecting some modules from default.px4board that I won’t be using. I’m curious how others solved it, and if there are any tips on how to minimize our data sections in custom modules.