# What problem could this be? Compiling the first Firmware, must be files missing

**URL:** <https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088>\
**Category:** Uncategorized\
**Created:** [December 9, 2017, 6:51am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088 "2017-12-09T06:51:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![northfly](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@northfly](https://discuss.px4.io/u/northfly)\
**Post date:** [December 9, 2017, 6:51am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/1 "2017-12-09T06:51:42Z")

</div>

This is my first time compiling the firmware. It is under ubuntu16.04.

I have succeeded all steps before “Snapdragon Flight section” in this page [Ubuntu/Debian Linux · PX4 Developer Guide](https://dev.px4.io/en/setup/dev_env_linux_ubuntu.html), I didn’t use the automatic sh files, instead I input each command manually and watch its results.  
I have successfully run “make posix jmavsim” and see the simulation windows and did the takeoff and land commanders.

However, when I try to go ahead and “make px4fmu-v2\_default”, I got this trunk of error message:

> [1/3] Linking CXX executable nuttx\_px4fmu-v2\_default.elf  
> FAILED: : && /usr/bin/arm-none-eabi-g++ -fno-common -ffunction-sections -fdata-sections -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fno-common -ffunction-sections -fdata-sections -g -fno-exceptions -fno-rtti -std=gnu++11 -fno-threadsafe-statics -DCONFIG\_WCHAR\_BUILTIN -D\_\_CUSTOM\_FILE\_IO\_\_ -fcheck-new -Wall -Warray-bounds -Wdisabled-optimization -Werror -Wextra -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-unused-parameter -Wunused-but-set-variable -Wformat=1 -Wdouble-promotion -Wno-missing-field-initializers -Wno-overloaded-virtual -Wreorder -fvisibility=hidden -include visibility.h -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -Os -DNDEBUG -mcpu=cortex-m4 -mthumb -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard -nodefaultlibs -nostdlib -Wl,–warn-common,–gc-sections src/firmware/nuttx/CMakeFiles/nuttx\_px4fmu-v2\_default.elf.dir/ **/** /platforms/empty.c.obj -o nuttx\_px4fmu-v2\_default.elf -L/home/xu/WorkPX4/src/Firmware/build/px4fmu-v2\_default/external/Install/lib -T/home/xu/WorkPX4/src/Firmware/build/px4fmu-v2\_default/NuttX/nuttx/configs/px4fmu-v2/scripts/ld.script -Wl,-Map=/home/xu/WorkPX4/src/Firmware/build/px4fmu-v2\_default/nuttx\_px4fmu-v2\_default.map -Wl,–warn-common -Wl,–gc-sections -Wl,–start-group msg/libuorb\_msgs.a src/drivers/airspeed/libdrivers\_\_airspeed.a src/drivers/boards/common/libboards\_common.a src/drivers/boards/common/stm32/libboard\_stm32.a src/drivers/boards/px4fmu-v2/libdrivers\_\_boards\_\_px4fmu-v2.a src/drivers/camera\_trigger/libdrivers\_\_camera\_trigger.a src/drivers/device/libdrivers\_\_device.a src/drivers/frsky\_telemetry/libdrivers\_\_frsky\_telemetry.a src/drivers/gps/libdrivers\_\_gps.a src/drivers/hmc5883/libdrivers\_\_hmc5883.a src/drivers/l3gd20/libdrivers\_\_l3gd20.a src/drivers/led/libdrivers\_\_led.a src/drivers/lis3mdl/libdrivers\_\_lis3mdl.a src/drivers/ll40ls/libdrivers\_\_ll40ls.a src/drivers/lsm303d/libdrivers\_\_lsm303d.a src/drivers/mpu6000/libdrivers\_\_mpu6000.a src/drivers/mpu9250/libdrivers\_\_mpu9250.a src/drivers/ms4525\_airspeed/libdrivers\_\_ms4525\_airspeed.a src/drivers/ms5525\_airspeed/libdrivers\_\_ms5525\_airspeed.a src/drivers/ms5611/libdrivers\_\_ms5611.a src/drivers/pwm\_input/libdrivers\_\_pwm\_input.a src/drivers/pwm\_out\_sim/libdrivers\_\_pwm\_out\_sim.a src/drivers/px4flow/libdrivers\_\_px4flow.a src/drivers/px4fmu/libdrivers\_\_px4fmu.a src/drivers/px4io/libdrivers\_\_px4io.a src/drivers/rgbled/libdrivers\_\_rgbled.a src/drivers/sdp3x\_airspeed/libdrivers\_\_sdp3x\_airspeed.a src/drivers/sf0x/libdrivers\_\_sf0x.a src/drivers/sf1xx/libdrivers\_\_sf1xx.a src/drivers/stm32/libdrivers\_\_stm32.a src/drivers/stm32/adc/libdrivers\_\_stm32\_\_adc.a src/drivers/stm32/tone\_alarm/libdrivers\_\_stm32\_\_tone\_alarm.a src/drivers/teraranger/libdrivers\_\_teraranger.a src/drivers/vmount/libdrivers\_\_vmount.a src/modules/sensors/libmodules\_\_sensors.a src/systemcmds/bl\_update/libsystemcmds\_\_bl\_update.a src/systemcmds/hardfault\_log/libsystemcmds\_\_hardfault\_log.a src/systemcmds/mixer/libsystemcmds\_\_mixer.a src/systemcmds/mtd/libsystemcmds\_\_mtd.a src/systemcmds/param/libsystemcmds\_\_param.a src/systemcmds/perf/libsystemcmds\_\_perf.a src/systemcmds/pwm/libsystemcmds\_\_pwm.a src/systemcmds/reboot/libsystemcmds\_\_reboot.a src/systemcmds/top/libsystemcmds\_\_top.a src/systemcmds/ver/libsystemcmds\_\_ver.a src/modules/camera\_feedback/libmodules\_\_camera\_feedback.a src/modules/commander/libmodules\_\_commander.a src/modules/events/libmodules\_\_events.a src/modules/land\_detector/libmodules\_\_land\_detector.a src/modules/load\_mon/libmodules\_\_load\_mon.a src/modules/mavlink/libmodules\_\_mavlink.a src/modules/navigator/libmodules\_\_navigator.a src/modules/ekf2/libmodules\_\_ekf2.a src/modules/fw\_att\_control/libmodules\_\_fw\_att\_control.a src/modules/fw\_pos\_control\_l1/libmodules\_\_fw\_pos\_control\_l1.a src/modules/gnd\_att\_control/libmodules\_\_gnd\_att\_control.a src/modules/gnd\_pos\_control/libmodules\_\_gnd\_pos\_control.a src/modules/mc\_att\_control/libmodules\_\_mc\_att\_control.a src/modules/mc\_pos\_control/libmodules\_\_mc\_pos\_control.a src/modules/vtol\_att\_control/libmodules\_\_vtol\_att\_control.a src/modules/logger/libmodules\_\_logger.a src/modules/dataman/libmodules\_\_dataman.a src/modules/systemlib/libmodules\_\_systemlib.a src/modules/systemlib/param/libmodules\_\_systemlib\_\_param.a src/modules/uORB/libmodules\_\_uORB.a src/lib/controllib/liblib\_\_controllib.a src/lib/conversion/liblib\_\_conversion.a src/lib/DriverFramework/framework/liblib\_\_DriverFramework\_\_framework.a src/lib/ecl/liblib\_\_ecl.a src/lib/geo/liblib\_\_geo.a src/lib/geo\_lookup/liblib\_\_geo\_lookup.a src/lib/launchdetection/liblib\_\_launchdetection.a src/lib/led/liblib\_\_led.a src/lib/mathlib/liblib\_\_mathlib.a src/lib/mathlib/math/filter/liblib\_\_mathlib\_\_math\_\_filter.a src/lib/mixer/liblib\_\_mixer.a src/lib/runway\_takeoff/liblib\_\_runway\_takeoff.a src/lib/tailsitter\_recovery/liblib\_\_tailsitter\_recovery.a src/lib/version/liblib\_\_version.a src/platforms/common/libplatforms\_\_common.a src/platforms/nuttx/libplatforms\_\_nuttx.a src/platforms/nuttx/px4\_layer/libplatforms\_\_nuttx\_\_px4\_layer.a NuttX/apps/libapps.a NuttX/nuttx/arch/arm/src/libarch.a NuttX/nuttx/binfmt/libbinfmt.a NuttX/nuttx/binfmt/libbinfmt.a NuttX/nuttx/libc/libc.a NuttX/nuttx/configs/libconfigs.a NuttX/nuttx/libxx/libcxx.a NuttX/nuttx/drivers/libdrivers.a NuttX/nuttx/fs/libfs.a NuttX/nuttx/mm/libmm.a NuttX/nuttx/sched/libsched.a -Wl,–end-group -lm -lgcc ROMFS/libromfs.a src/lib/DriverFramework/framework/src/libdf\_driver\_framework.a && :  
> /LinuxSpace/Softwares/PX4/Development/ToolChain/gcc-arm-none-eabi-5\_4-2016q2/bin/…/lib/gcc/arm-none-eabi/5.4.1/…/…/…/…/arm-none-eabi/bin/ld: nuttx\_px4fmu-v2\_default.elf section `.data' will not fit in region `flash’  
> /LinuxSpace/Softwares/PX4/Development/ToolChain/gcc-arm-none-eabi-5\_4-2016q2/bin/…/lib/gcc/arm-none-eabi/5.4.1/…/…/…/…/arm-none-eabi/bin/ld: region `flash’ overflowed by 1797 bytes  
> collect2: error: ld returned 1 exit status  
> ninja: build stopped: subcommand failed.  
> Makefile:153: recipe for target ‘px4fmu-v2\_default’ failed  
> make: \*\*\* [px4fmu-v2\_default] Error 1

I don’t know what is this, and where this error comes from? any dependency or toolchain problems?  
could any one help me out?

---

<div class="post-metadata">

**Author:** ![CarlOlsson](https://discuss.px4.io/user_avatar/discuss.px4.io/carlolsson/32/4175_2.png) [@CarlOlsson](https://discuss.px4.io/u/CarlOlsson)\
**Post date:** [December 9, 2017, 3:23pm UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/2 "2017-12-09T15:23:25Z")

</div>

try “make px4fmu-v4\_default”

---

<div class="post-metadata">

**Author:** ![northfly](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@northfly](https://discuss.px4.io/u/northfly)\
**Post date:** [December 9, 2017, 4:16pm UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/3 "2017-12-09T16:16:08Z")

</div>

thanks for your reply, i am not near the computer right now, i will try it asap. but i tried “make px4mu\_v3\_default”, the message is similar.

---

<div class="post-metadata">

**Author:** ![CarlOlsson](https://discuss.px4.io/user_avatar/discuss.px4.io/carlolsson/32/4175_2.png) [@CarlOlsson](https://discuss.px4.io/u/CarlOlsson)\
**Post date:** [December 9, 2017, 8:34pm UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/4 "2017-12-09T20:34:31Z")

</div>

Yes you are out of flash memory on v2 and apparently v3 if you got the same message. Here is some more info

> [@Building errors when building px4fmu-v2\_default in ubuntu](http://discuss.px4.io/t/building-errors-when-building-px4fmu-v2-default-in-ubuntu/2128):
>
> Today I updated the PX4 source code from github and build it as usual. But when I use the command “make px4fmu-v2\_default”, errors occurred! And I didn’t meet this problem before. Anyone can help me? Thank you a lot! Need I update the arm-none-eabi? But the version of my arm-none-eabi is 4.9, higher than the required version 4.8.

---

<div class="post-metadata">

**Author:** ![northfly](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@northfly](https://discuss.px4.io/u/northfly)\
**Post date:** [December 10, 2017, 12:07am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/5 "2017-12-10T00:07:59Z")

</div>

Thanks, Carl, Looks like it went through, however, it didn’t show up the 100% finished message as shown in [Building the Code · PX4 Developer Guide](https://dev.px4.io/en/setup/building_px4.html)

it shows this:

> – Build Type: MinSizeRel  
> – PX4 VERSION: v1.7.0-rc3-76-g324c515  
> – CONFIG: nuttx\_px4fmu-v4\_default  
> – Build Type: MinSizeRel  
> – The ASM compiler identification is GNU  
> – Found assembler: /LinuxSpace/Softwares/PX4/Development/ToolChain/gcc-arm-none-eabi-5\_4-2016q2/bin/arm-none-eabi-gcc  
> – Found PythonInterp: /usr/bin/python (found version “2.7.12”)  
> – Found PY\_jinja2: /usr/local/lib/python2.7/dist-packages/jinja2  
> – C compiler: arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]  
> – C++ compiler: arm-none-eabi-g++ (GNU Tools for ARM Embedded Processors) 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715]  
> – Using C++03  
> – Release build type: MinSizeRel  
> – Adding UAVCAN STM32 platform driver  
> – NuttX: px4fmu-v4 nsh cortex-m4  
> – ROMFS: px4fmu\_common  
> – Configuring done  
> – Generating done  
> – Build files have been written to: /home/xu/WorkPX4/src/Firmware/build/px4fmu-v4\_default  
> [897/897] Creating /home/xu/WorkPX4/sr…x4fmu-v4\_default/px4fmu-v4\_default.px4

Is this a success? If it is I actually have another question, I only have Pixhawk 2 board, could I load V4 firmware into it? Or Is there anyway, I can set a constraint to the flash memory when compiling, so that the v2 and v3 can also be compiled?

---

<div class="post-metadata">

**Author:** ![CarlOlsson](https://discuss.px4.io/user_avatar/discuss.px4.io/carlolsson/32/4175_2.png) [@CarlOlsson](https://discuss.px4.io/u/CarlOlsson)\
**Post date:** [December 10, 2017, 7:36am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/6 "2017-12-10T07:36:38Z")

</div>

> [@northfly](#):
>
> Is this a success? If it is I actually have another question, I only have Pixhawk 2 board, could I load V4 firmware into it? Or Is there anyway, I can set a constraint to the flash memory when compiling, so that the v2 and v3 can also be compiled?

Yes it is a success. No you can not flash v4 onto it. Try to remove things you don’t need from the [makefile](https://github.com/PX4/Firmware/tree/bc9a8e443267a255cc6bbad49801de96e2f4c153/cmake/configs)

---

<div class="post-metadata">

**Author:** ![northfly](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/aca169/32.png) [@northfly](https://discuss.px4.io/u/northfly)\
**Post date:** [December 10, 2017, 8:40am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/7 "2017-12-10T08:40:19Z")

</div>

so the socalled “remove modules” is to remove things from makefile?  
The other thing, if I am a px4 developer, does that mean I cannot use a normal version of Qgroundcontrol? Can I install the QGroundControl stable version normally, while load my newly compiled firmware from QGC and load it to a plane? and I cannot find the related documentations, could you help me out? Thank you very much!

---

<div class="post-metadata">

**Author:** ![CarlOlsson](https://discuss.px4.io/user_avatar/discuss.px4.io/carlolsson/32/4175_2.png) [@CarlOlsson](https://discuss.px4.io/u/CarlOlsson)\
**Post date:** [December 10, 2017, 9:02am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/8 "2017-12-10T09:02:50Z")

</div>

> [@northfly](#):
>
> so the socalled “remove modules” is to remove things from makefile?

yes

> [@northfly](#):
>
> The other thing, if I am a px4 developer, does that mean I cannot use a normal version of Qgroundcontrol? Can I install the QGroundControl stable version normally, while load my newly compiled firmware from QGC and load it to a plane? and I cannot find the related documentations, could you help me out? Thank you very much!

Not sure what you mean here. If you develop code it is usually easier to flash the firmware without QGC directly using e.g. “make px4fmu-v2\_default upload”. Then when testing you can use standard QGC, or the daily build if you need something that is not in stable yet. Regarding the documentation, if something is missing from the dev guide please raise an issue on the [repo](https://github.com/pX4/devguide)

---

<div class="post-metadata">

**Author:** ![StarBrain.M](https://discuss.px4.io/user_avatar/discuss.px4.io/starbrain.m/32/1776_2.png) [@StarBrain.M](https://discuss.px4.io/u/StarBrain.M)\
**Post date:** [January 31, 2018, 5:38am UTC](https://discuss.px4.io/t/what-problem-could-this-be-compiling-the-first-firmware-must-be-files-missing/5088/9 "2018-01-31T05:38:22Z")

</div>

I met the same problem recently and I have changed the MEMORY-flahs(rx)-LENGTH in` ./platforms/nuttx/nuttx-configs/px4fmu-v2/scripts/ld.script` . it’s working now.

 ![](https://discuss.px4.io/uploads/default/original/2X/2/253f140ec8a28d8992d0f147e5ab1703b5fc23af.PNG)  
you can also check this [blog](http://blog.csdn.net/linkcian/article/details/79204094) for more details. And here is the result.  
 ![](https://discuss.px4.io/uploads/default/original/2X/f/fd54520b55f0c08ec613db5dadd20107e1731026.PNG)
