[Unsolved] Unable to build firmware under Qt Creator, any idea is appreciated

Hi everyone,

I just encountered a problem when I am trying to build and upload the firmware to Pixhawk through the Qt Creator IDE under Mac OS. I hope you could help me solve this problem as I have tried to solve it by myself for several days, but I still couldn’t get it.

This situation occurred under this background: I followed the guidelines from (http://dev.px4.io/starting-building.html) and already built and uploaded the firmware to Pixhawk successfully using the terminal command line. However, when I try to recurrent it in the Qt Creator IDE, I thought I could build the firmware successfully (as in Figure 2), but couldn’t upload it to the pixhawk. Following all of the guidelines and add a Customized executable command “make” and the associated argument “upload”, I press the green Botton to start the build and upload procedure. You can refer to the below figure for my configuration and results,

Figure 1


Figure 2

Figure 3

As you can see, Figure 3 showed that “No rule to make target `upload’”. After that, I searched a lot and found there were also some developers encounter this problem but I didn’t found any solutions from their posts and answers.

Referring to Mr. Bart Slinger’s answer (How to build Firmware for px4fmu-v2_default using Qt Creator in Linux?), I tried his method, i.e. I changed the Cmake CONFIG value from "posix_sitl_default to “nuttx_px4fmu-v2_default” as shown in Figure 4,


Figure 4
and then I try to execute the build procedure, I received the below info.,
.
Figure 5
So I am confusing about this situation and want to know is there any other configurations shall I do before the build and upload procedure under Qt Creator IDE?

BTW, I would like to list my build environment as.

Operation Sys: Mac OS Sierra;
Qt Creator Version: 4.1.0 Based on Qt 5.7.0(Clang 7.0(Apple), 64 bit)
CMake Version: 3.6.0

I wonder it would be boring for your experts to see these figures. I hope any of you could help me solve this problem. I hope I could edit the code and flash to my pixhawk under this recommended IDE.

Thanks for your patience and help~

Any possible solution is highly appreciated~

All the best

Tao Zhang@AU

I’m also still experiencing some issues. Last time I tried I had to choose another build configuration. You now selected Default, but there is also an option “Release with Debug Information”. This weird sequence of events made it work for me:

  1. Add a build configuration “Release with Debug Information”
  2. Set config to “nuttx_px4fmu-v2_default”
  3. Click Apply (For some reason, it does not yet update the other settings)
  4. Click BUILD and then suddenly all of these settings change to the right values (for example CXX_COMPILER changes to /usr/bin/arm-none-eabi-g++)

Hi Mr. Bart,

I followed your instructions as you said and it still does not work for me, I attached the figure below. Is that what do you mean?


Figure 6

Figure 7

As you can see in Figure 7, it showed that “fatal error: unknown target CPU ‘armv7e-m’”

Anyway, thanks very much for your approach.

I hope this is not a common problem.

Thanks and waiting for further solutions and ideas.

All the best~

Tao Zhang@AU

How did you install cmake? I have version 3.5.2 which I got from following the instructions here: http://dev.px4.io/starting-installing-linux.html

Hi Mr. Bart,

I didn’t install Cmake specially as I think it comes with the Xcode 8 in Mac OS. I remember after install the Xcode, I checked the Cmake version in the terminal command line using “Cmake --version”, as you can see below. Is it ok? How do you think?

Thanks,

All the best

Tao Zhang@AU

Ok I’m afraid I cannot help you any further. It seems you do exactly the same as I do, except that I am on Linux Mint 18 and have cmake 3.5.2

Hi Mr. Bart,

That’s ok. You already helped a lot on my cases. Thank you anyway for your kind help. Maybe we’ll discuss any other topics in future.

I also hope someone else who is experienced with this Qt Creator software could provide any possible solutions. I would like to try any methods to solve this problem.

Thanks Mr. Bart again and I’m waiting for anyone who could help me.

All the best~

Tao Zhang@AU

In order to test the availability of the Cmake function, I uninstall the Cmake version 3.6.0 and install a new version 3.6.2. I re-test the build environment under terminal command, as shown below(I copy the output code from the terminal):

➜ firmware git:(master) make px4fmu-v2_default upload
– nuttx-px4fmu-v2-default
– CMAKE_INSTALL_PREFIX:
– cmake module path: /Users/tao/OneDrive/Download/Mac/Pixhawk/PX4_Pro/Firmware/cmake
CMake Deprecation Warning at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:79 (message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler)
/Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:216 (project)

CMake Deprecation Warning at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:93 (message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler)
/Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:216 (project)

CMake Deprecation Warning at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:79 (message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler)
build_px4fmu-v2_default/CMakeFiles/3.6.2/CMakeSystem.cmake:6 (include)
CMakeLists.txt:216 (project)

CMake Deprecation Warning at /Applications/CMake.app/Contents/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:93 (message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler)
build_px4fmu-v2_default/CMakeFiles/3.6.2/CMakeSystem.cmake:6 (include)
CMakeLists.txt:216 (project)

– The ASM compiler identification is GNU
– Found assembler: /usr/local/bin/arm-none-eabi-gcc
– catkin DISABLED
– Found PythonInterp: /usr/bin/python2.7 (found suitable version “2.7.10”, minimum required is “2.7”)
– Using C++03
– Release build type: RelWithDebInfo
– Adding UAVCAN STM32 platform driver
– GIT_TAG = v1.5.0-389-gffaed18
– Configuring done
– Generating done
– Build files have been written to: /Users/tao/OneDrive/Download/Mac/Pixhawk/PX4_Pro/Firmware/build_px4fmu-v2_default
PX4 CONFIG: /Users/tao/OneDrive/Download/Mac/Pixhawk/PX4_Pro/Firmware/build_px4fmu-v2_default
ninja: Entering directory `/Users/tao/OneDrive/Download/Mac/Pixhawk/PX4_Pro/Firmware/build_px4fmu-v2_default’
[505/506] uploading /Users/tao/OneDrive/Download/Mac/Pixhawk/PX4_Pro/Firmware/build_px4fmu-v2_default/src/firmware/nuttx/nuttx-px4fmu-v2-default.px4
Loaded firmware for 9,0, size: 1030732 bytes, waiting for the bootloader…
If the board does not respond within 1-2 seconds, unplug and re-plug the USB connector.
attempting reboot on /dev/tty.usbmodem1…
if the board does not respond, unplug and re-plug the USB connector.
Found board 9,0 bootloader rev 4 on /dev/tty.usbmodem1
50583400 00ac2600 00100000 00ffffff ffffffff ffffffff ffffffff ffffffff 58013ad0 6583fc63 97ae0af8 eb18257a e0dfa012 f6a9a134 15325ba2 644b5fe8 c7d1a70e 1157ba49 a46e5865 e67a4862 f1fce3f0 8694550e 358e50f5 f9bf1ceb ee47bc60 66a8f8c0 80125ec6 99a19cff adc99d78 abf26154 63905a07 e75a081e a747fb88 6e19e2e0 d4196df6 3adb6d9b e3d0d1d1 ab80ffb4 a1960186 393c75cf ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff type: PX4
idtype: =00
vid: 000026ac
pid: 00000010
coa: WAE60GWD/GOXrgr46xgleuDfoBL2qaE0FTJbomRLX+jH0acOEVe6SaRuWGXmekhi8fzj8IaUVQ41jlD1+b8c6+5HvGBmqPjAgBJexpmhnP+tyZ14q/JhVGOQWgfnWggep0f7iG4Z4uDUGW32Otttm+PQ0dGrgP+0oZYBhjk8dc8=

sn: 002f00223534510534343430

Erase : [====================] 100.0%
Program: [====================] 100.0%
Verify : [====================] 100.0%
Rebooting.

As you can see the figure as well.

It seemed all the build and upload process are good under the terminal command environment. However, when I try it in the Qt Creator environment, the configuration is same as posted yesterday (I also re-screenshot and post it today as below): change the default environment to “Release with Debug Information” and change the CONFIG value from “posix_sitl_default to “nuttx_px4fmu-v2_default” and then try to build the firmware, while it still appeared abort due to " unknown target CPU ‘armv7e-m’”…

Can any developers help me analysis this phenomenon and provide any possible solutions for me?

I would like to try any ideas.

Thanks for your help in advance~

Tao Zhang@AU

Hi, is there anyone find solution for this phenomenon?

Thanks very much in advance,

All the best

Tao Zhang@AU

@taozhangAU Have you solved this problem? I meet this problem too.

I also had the "No rule to make target ‘upload’. Stop " error but I was able to figure it out. I hope this works out for everyone.

I am going to attach screenshots of my settings with some explanations where necessary.

After loading the CMakeLists.txt in the root firmware folder via File → Open File or Project → Select the CMakeLists.txt file, I clicked on the Projects tab to apply the settings.

For the Build section, these are the settings I used:

For the Run section, these were the settings I used:

Under Run(After Deployment), click on ‘Add’ and choose ‘Custom Executable’. Fill in the Executable as ‘make’ and the command like arguments as ‘upload’. MAKE SURE YOU ADD THE WORKING DIRECTORY I USED. Other directories didn’t work for me, leaving it blank also leads to an error.

Then click on the Play Button and it should run perfectly and upload to the pixhawk. My result:

I hope this helps.

Cheers,
Chinedu

Hi, sorry for the late reply. We can refer to the above solution. I didn’t try it yet.

Hi Chinedu_Amadi,

Thanks very much for your solution. I’ll try it later.

Hi Bart,

I still have issue with building PX4 with qtcreator on ubuntu 14.04 setup.
Can you show your Manage Kits setup for me?
How did you set the compiler option?
Thanks,

Kyu

i tried this and it works