# Error while building PX4 firmware for PX4FMU-V2

**URL:** <https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058>\
**Category:** Uncategorized\
**Created:** [December 28, 2016, 11:49am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058 "2016-12-28T11:49:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nickvot](https://discuss.px4.io/user_avatar/discuss.px4.io/nickvot/32/729_2.png) [@Nickvot](https://discuss.px4.io/u/Nickvot)\
**Post date:** [December 28, 2016, 11:49am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/1 "2016-12-28T11:49:27Z")

</div>

Hi, I’m currently working on PX4 firmware 1.5.2. I tried to build by following the PX4 development guide but I got this error message.

```
Scanning dependencies of target nuttx_export_px4fmu-v2
[3%] Building NuttX for px4fmu-v2
[3%] Built target libuavcan_dsdlc
[4%] Generating airframes.xml
make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
make[4]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
make[4]: warning: -jN forced in submake: disabling jobserver mode.
make[4]: warning: -jN forced in submake: disabling jobserver mode.
string/lib_memchr.c: In function 'memchr':
string/lib_memchr.c:66:6: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
   if (s)
      ^
cc1: all warnings being treated as errors
make[5]: *** [bin/lib_memchr.o] Error 1
make[4]: *** [libc/libc.a] Error 2
make[4]: *** Waiting for unfinished jobs....
[4%] Built target xml_gen
string/lib_memchr.c: In function 'memchr':
string/lib_memchr.c:66:6: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
   if (s)
      ^
cc1: all warnings being treated as errors
make[5]: *** [bin/lib_memchr.o] Error 1
make[4]: *** [libc/libc.a] Error 2
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [px4io-v2.export] Error 2
make[2]: *** [src/modules/px4iofirmware/CMakeFiles/nuttx_export_px4io-v2.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
make[3]: *** [px4fmu-v2.export] Error 2
make[2]: *** [CMakeFiles/nuttx_export_px4fmu-v2.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [px4fmu-v2_default] Error 2

```

It works well when I build it with commands “make” or “make posix\_sitl\_default gazebo”. What should I do to build PX4 firmware for PX4 FMU?

---

<div class="post-metadata">

**Author:** ![LorenzMeier](https://discuss.px4.io/user_avatar/discuss.px4.io/lorenzmeier/32/17_2.png) [@LorenzMeier](https://discuss.px4.io/u/LorenzMeier)\
**Post date:** [December 28, 2016, 1:03pm UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/2 "2016-12-28T13:03:32Z")

</div>

You have GCC 6 but we’re only supporting versions up to GCC 5 right now. You can install GCC 5 from here: [http://dev.px4.io/starting-installing-linux-boutique.html#toolchain-installation](http://dev.px4.io/starting-installing-linux-boutique.html#toolchain-installation)

---

<div class="post-metadata">

**Author:** ![Nickvot](https://discuss.px4.io/user_avatar/discuss.px4.io/nickvot/32/729_2.png) [@Nickvot](https://discuss.px4.io/u/Nickvot)\
**Post date:** [December 28, 2016, 1:59pm UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/3 "2016-12-28T13:59:32Z")

</div>

Thank you so much. It finally works.

Actually, I’ve tried that but  
exportline=“export PATH=$HOME/gcc-arm-none-eabi-5\_4-2016q2/bin:$PATH”  
that didn’t work for me.

However,  
exportline=“export PATH=$HOME/gcc-arm-none-eabi-5\_4-2016q2/bin:$PATH”  
works well for me.

I really appreciate you for your help.

---

<div class="post-metadata">

**Author:** ![Mark\_Whitehorn](https://discuss.px4.io/user_avatar/discuss.px4.io/mark_whitehorn/32/3533_2.png) [@Mark\_Whitehorn](https://discuss.px4.io/u/Mark_Whitehorn)\
**Post date:** [December 28, 2016, 5:53pm UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/4 "2016-12-28T17:53:48Z")

</div>

@Nickvot Read [https://linux.die.net/Bash-Beginners-Guide/sect\_03\_03.html](https://linux.die.net/Bash-Beginners-Guide/sect_03_03.html) to understand the reason for the presence of that backslash

---

<div class="post-metadata">

**Author:** ![Nickvot](https://discuss.px4.io/user_avatar/discuss.px4.io/nickvot/32/729_2.png) [@Nickvot](https://discuss.px4.io/u/Nickvot)\
**Post date:** [December 29, 2016, 1:27am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/5 "2016-12-29T01:27:36Z")

</div>

Thank you for your help. It was to preserve the $ mark right? I think I should learn more about Linux commands.

---

<div class="post-metadata">

**Author:** ![JJWMr](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@JJWMr](https://discuss.px4.io/u/JJWMr)\
**Post date:** [December 29, 2016, 8:46am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/6 "2016-12-29T08:46:36Z")

</div>

Hi,I tried this method.But it did not work. Because the gcc-arm-embedded is the newest on 6.2.1. Could you give a version of gcc-arm-embedded on 5.2.1?

---

<div class="post-metadata">

**Author:** ![shulin\_wei](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ecb155/32.png) [@shulin\_wei](https://discuss.px4.io/u/shulin_wei)\
**Post date:** [December 29, 2016, 9:43am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/7 "2016-12-29T09:43:25Z")

</div>

you can follow the [http://dev.px4.io/starting-installing-linux-boutique.html#toolchain-installation](http://dev.px4.io/starting-installing-linux-boutique.html#toolchain-installation) to install the GCC5 ,and that i think is okay.

---

<div class="post-metadata">

**Author:** ![JJWMr](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@JJWMr](https://discuss.px4.io/u/JJWMr)\
**Post date:** [December 29, 2016, 9:58am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/8 "2016-12-29T09:58:15Z")

</div>

Thank you! I followed this introduction,but there was the same build error. “export PATH=/home/ji/gcc-arm-none-eabi-5\_4-2016q2/bin:$PATH” is already in .profile. Could you give me some advices on my problem?

---

<div class="post-metadata">

**Author:** ![shulin\_wei](https://discuss.px4.io/letter_avatar_proxy/v4/letter/s/ecb155/32.png) [@shulin\_wei](https://discuss.px4.io/u/shulin_wei)\
**Post date:** [December 29, 2016, 10:08am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/9 "2016-12-29T10:08:25Z")

</div>

sorry， i am not the developer ， i have met the same problem as you . and I solve it through i stupid method which is reinstall the OS and retry.

---

<div class="post-metadata">

**Author:** ![JJWMr](https://discuss.px4.io/letter_avatar_proxy/v4/letter/j/54ee81/32.png) [@JJWMr](https://discuss.px4.io/u/JJWMr)\
**Post date:** [December 29, 2016, 10:15am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/10 "2016-12-29T10:15:57Z")

</div>

Thanks, anyway. I will keep tracking on this issue.

---

<div class="post-metadata">

**Author:** ![hamid-m](https://discuss.px4.io/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@hamid-m](https://discuss.px4.io/u/hamid-m)\
**Post date:** [January 4, 2017, 3:24am UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/11 "2017-01-04T03:24:06Z")

</div>

@JJWMr, I was facing the error message above but the exact instructions on the dev page (linked above) for installing GCC 5.4 on Ubuntu 16.04 worked.

However, I just wanted to point out that you may need to log out once before trying to build again. The instructions add a line to the `.profile` file which I believe is only run upon logging in. So after following the installation instructions be sure to restart and then see if that resolves the building problem above.

---

<div class="post-metadata">

**Author:** ![renyusang](https://discuss.px4.io/letter_avatar_proxy/v4/letter/r/8c91f0/32.png) [@renyusang](https://discuss.px4.io/u/renyusang)\
**Post date:** [August 17, 2017, 3:34pm UTC](https://discuss.px4.io/t/error-while-building-px4-firmware-for-px4fmu-v2/2058/12 "2017-08-17T15:34:28Z")

</div>

Whether that backslash needed or not? I install GCC5.4 failed with that backslash
