# How to build Firmware for px4fmu-v2\_default using Qt Creator in Linux?

**URL:** <https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220>\
**Category:** Uncategorized\
**Created:** [September 16, 2016, 2:49am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220 "2016-09-16T02:49:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![NJG](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@NJG](https://discuss.px4.io/u/NJG)\
**Post date:** [September 16, 2016, 2:49am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/1 "2016-09-16T02:49:32Z")

</div>

Hi guys,  
How do we build Firmware for px4fmu-v2\_default using Qt Creator in Linux? I followed the instruction at [http://dev.px4.io/starting-building.html](http://dev.px4.io/starting-building.html). Ran  
cd ~/src/Firmware  
mkdir …/Firmware-build  
cd …/Firmware-build  
cmake …/Firmware -G “CodeBlocks - Unix Makefiles”  
Then made a build. But it build for target posix only. There is no target px4fmu-v2\_default in the Makefile.

---

<div class="post-metadata">

**Author:** ![Bart](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@Bart](https://discuss.px4.io/u/Bart)\
**Post date:** [September 16, 2016, 6:25am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/2 "2016-09-16T06:25:21Z")

</div>

If you just do a “make px4fmu-v2\_default” in the main Firmware folder, it will make a build directory there.

---

<div class="post-metadata">

**Author:** ![NJG](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@NJG](https://discuss.px4.io/u/NJG)\
**Post date:** [September 16, 2016, 3:31pm UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/3 "2016-09-16T15:31:12Z")

</div>

Bart, you are talking about building from command line. But I really want to build in Qt Creator since I am modifying the code in IDE and want to see the build result from there right away.

---

<div class="post-metadata">

**Author:** ![Bart](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@Bart](https://discuss.px4.io/u/Bart)\
**Post date:** [September 16, 2016, 7:28pm UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/4 "2016-09-16T19:28:02Z")

</div>

In that case, just open the CMakeLists.txt in QtCreator

From the manual:

> Then load the CMakeLists.txt in the root firmware folder via File →   
> Open File or Project → Select the CMakeLists.txt file.

---

<div class="post-metadata">

**Author:** ![NJG](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@NJG](https://discuss.px4.io/u/NJG)\
**Post date:** [September 22, 2016, 3:03am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/5 "2016-09-22T03:03:43Z")

</div>

Bart,  
That’s what I did. But Qt Creator makes posix build by default. I want to build for px4fmu-v2\_default. How can I change target/platform in Qt Creator?

---

<div class="post-metadata">

**Author:** ![Bart](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/f19dbf/32.png) [@Bart](https://discuss.px4.io/u/Bart)\
**Post date:** [September 22, 2016, 8:48am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/6 "2016-09-22T08:48:48Z")

</div>

Go to the projects tab and in the cmake settings, change CONFIG to nuttx\_px4fmu-v2\_default

 ![](https://discuss.px4.io/uploads/default/original/1X/ee3f4893cae5779f32c90e489fd26c662e3ba369.png)

---

<div class="post-metadata">

**Author:** ![NJG](https://discuss.px4.io/letter_avatar_proxy/v4/letter/n/43a26b/32.png) [@NJG](https://discuss.px4.io/u/NJG)\
**Post date:** [September 23, 2016, 2:53am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/7 "2016-09-23T02:53:45Z")

</div>

I don’t have CONFIG. See following screen shot.

BTW, how to run cmake for nuttx\_px4fmu-v2\_default? I am not familiar with cmake. Is following command just used to build for posix? What options need to give to cmake for nuttx build?

cmake …/Firmware -G “CodeBlocks - Unix Makefiles”

 ![](https://discuss.px4.io/uploads/default/original/1X/c270a5630e11199250e5ceb5ddda6df29693e090.png)

---

<div class="post-metadata">

**Author:** ![yidengfeiwu](https://discuss.px4.io/letter_avatar_proxy/v4/letter/y/b9e5f3/32.png) [@yidengfeiwu](https://discuss.px4.io/u/yidengfeiwu)\
**Post date:** [December 2, 2016, 5:01am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/8 "2016-12-02T05:01:34Z")

</div>

maybe you can try a new version of Qt creator,and you will find CONFIG.

---

<div class="post-metadata">

**Author:** ![Michael](https://discuss.px4.io/letter_avatar_proxy/v4/letter/m/4bbf92/32.png) [@Michael](https://discuss.px4.io/u/Michael)\
**Post date:** [December 11, 2016, 12:17pm UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/9 "2016-12-11T12:17:34Z")

</div>

First run a make px4fmu-v2\_default in your Firmware Folder. That would generate the folder build\_px4fmu-v2\_default.

Change the Build directory in QT directly to `Firmware/build_px4fmu-v2_default`  
You also have to change the PATH under Build Environment like it is shown in the tutorial video.

---

<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 13, 2016, 8:18am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/10 "2016-12-13T08:18:05Z")

</div>

Hi,NJG  
I have the same problem as you and i was wondering whether you have solve the problem.

---

<div class="post-metadata">

**Author:** ![Gabriel\_Moreno](https://discuss.px4.io/user_avatar/discuss.px4.io/gabriel_moreno/32/4618_2.png) [@Gabriel\_Moreno](https://discuss.px4.io/u/Gabriel_Moreno)\
**Post date:** [October 19, 2017, 8:11pm UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/11 "2017-10-19T20:11:15Z")

</div>

With the instructions in this page [https://dev.px4.io/en/setup/building\_px4.html#qt-creator-on-linux](https://dev.px4.io/en/setup/building_px4.html#qt-creator-on-linux) I can only build the posix target. I tried the other suggestions mentioned above but they didn’t work (I tried Qt Creator 3.5.1 and 4.4.1).

I’m sure this is not the right way to do it, but this is what I did to make it work:  
-made the following change to Firmware/Makefile  
PX4\_CMAKE\_GENERATOR := “Unix\ Makefiles” --\> PX4\_CMAKE\_GENERATOR := “CodeBlocks\ -\ Unix\ Makefiles”  
-built the target from the command line: make px4fmu-v2\_default  
-opened Firmware/CMakeLists.txt with Qt Creator 3.5.1  
-when asked for the build location, changed it to Firmware/build/px4fmu-v2\_default  
-clicked Next and then Finish

It would be nice if someone could update the documentation with the appropriate instructions for the current Qt Creator version and without this hack I did changing Makefile

---

<div class="post-metadata">

**Author:** ![IronClimber](https://discuss.px4.io/user_avatar/discuss.px4.io/ironclimber/32/4014_2.png) [@IronClimber](https://discuss.px4.io/u/IronClimber)\
**Post date:** [June 21, 2019, 9:49am UTC](https://discuss.px4.io/t/how-to-build-firmware-for-px4fmu-v2-default-using-qt-creator-in-linux/1220/12 "2019-06-21T09:49:40Z")

</div>

Hello! I found solution for Pixhawk 2.1. Maybe it can work for you:

> [@QT Creator no rule to make target 'upload' error](https://discuss.px4.io/t/qt-creator-no-rule-to-make-target-upload-error/4708/4):
>
> Hello! I found solution for me. I use Ubuntu 16.04 and upload firmware to Pixhawk 2.1 I make same 1-4 steps, but 5 is different. BUILD section Build directory: /home/stepan/src/Firmware-build RUN section Make custom executable. Executable: make Command line arguments: px4\_fmu-3v\_default upload Working directory: /home/stepan/src/Firmware Then click run.
