Unable to buid PX4 firmware on beaglebone blue

Hi all,
I tried to build the PX4 Firmware for a beaglebone blue card I bought some days ago.
I tried to build it on the board itself (native build) as proposed in the web page below but did not succeed:
https://docs.px4.io/v1.9.0/en/flight_controller/beaglebone_blue.html

Could someone help me?
Is there a cookbook somewhere that I can follow ?

thanks a lot
Sylvain

Check if the master version of the docs have anything different: https://docs.px4.io/master/en/flight_controller/beaglebone_blue.html

And if it doesn’t work, what is the error? (a bit hard to help without knowing that)

Hello Julian,

Thanks for your reply.
I followed the steps for natives builds in this guideline.

Here is the results of the directories installed on my BBB:
debian@beaglebone:~$ ls -l
total 16
drwxr-xr-x 2 debian debian 4096 Apr 6 13:33 bin
drwxr-xr-x 23 debian debian 4096 Apr 20 15:24 Firmware
drwxr-xr-x 14 debian debian 4096 Apr 20 16:10 librobotcontrol

librobotcontrol compiled successfully but Firmware did not (see below - I am not sure about the make command actually):

debian@beaglebone:~$ cd Firmware
debian@beaglebone:~/Firmware$ make
[ 0%] Built target lockstep_scheduler
[ 0%] Built target drivers_board
[ 2%] Built target df_driver_framework
[ 2%] Built target uorb_headers
Scanning dependencies of target mixer_gen_6dof
Scanning dependencies of target ver_gen
[ 2%] Generating …/…/logs
[ 2%] Generating mixer_multirotor.generated.h
[ 2%] Generating mixer_multirotor_6dof.generated.h
[ 2%] Generating git version header
('python import error: ', ImportError(‘No module named toml’,))

Required python packages not installed.

On a GNU/Linux or MacOS system please run:
sudo pip install numpy toml

On Windows please run:
easy_install numpy toml

('python import error: ', ImportError(‘No module named toml’,))

Required python packages not installed.

On a GNU/Linux or MacOS system please run:
sudo pip install numpy toml

On Windows please run:
easy_install numpy toml

make[3]: *** [src/lib/mixer/CMakeFiles/mixer_gen.dir/build.make:83: src/lib/mixer/mixer_multirotor.generated.h] Error 1
make[2]: *** [CMakeFiles/Makefile2:4181: src/lib/mixer/CMakeFiles/mixer_gen.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…
make[3]: *** [src/lib/mixer/CMakeFiles/mixer_gen_6dof.dir/build.make:82: src/lib/mixer/mixer_multirotor_6dof.generated.h] Error 1
make[2]: *** [CMakeFiles/Makefile2:4115: src/lib/mixer/CMakeFiles/mixer_gen_6dof.dir/all] Error 2
[ 2%] Built target logs_symlink
[ 2%] Built target ver_gen
make[1]: *** [Makefile:152: all] Error 2
make: *** [Makefile:195: px4_sitl_default] Error 2

What firmware version is this? It looks older.

Also it tells you clearly about missing pip packages.

1 Like

I got the latest version (V1.10.0) .
What is pip ? How can I install it?

You’re on latest stable then, not master.

sudo apt-get install python-pip
pip install --user numpy toml

etc.

1 Like

pip install seems stuck on:
Running setup.py bdist_wheel for numpy … /

How long this installation should be ?

Ok, actually, let’s take a step back. I would not bother trying to compile PX4 on the beagle bone but cross-compile on your computer and then copy the binaries over. That will overall be faster for sure.

https://docs.px4.io/master/en/flight_controller/beaglebone_blue.html#cross-compiler-build-recommend

pip install is ok.

I restart make command and I got a new error:

[ 28%] Linking CXX static library libuorb_msgs.a
[ 28%] Built target uorb_msgs
make[1]: *** [Makefile:152: all] Error 2
make: *** [Makefile:195: px4_sitl_default] Error 2

I don’t think compiling on the BeagleBone is recommended or supported anymore. Please try the cross compilation.

Hi Julian,
Ok, let’s try to cross-compile PX4 Firmware on my Windows laptop.
I downloaded GCC for 64bit arch below:
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf.tar

Is this the good one? (knowing that I am running on 64bit arch)

Thanks

I don’t know if this is possible on Windows. @MaEtUgR might know.

Do you mean I have to execute this binary on Linux machine (such as Ubuntu)?
I expect to find a way to cross compile with cygwin as I did for sim env, but now for BBB.

It might be able in cygwin but you need to find that toolchain that works for it.

Hello Julien,

I tried gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf.

It works better but I am now stuck on the error below. Any advice :)?

[5/745] Building CXX object src/lib/DriverFramework/framework/src/CMakeFiles/df_driver_framework.dir/DevObj.cpp.o
FAILED: src/lib/DriverFramework/framework/src/CMakeFiles/df_driver_framework.dir/DevObj.cpp.o
/opt/bbblue_toolchain/gcc-arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++.exe -DCONFIG_ARCH_BOARD_BEAGLEBONE_BLUE -DRC_AUTOPILOT_EXT -D__CUSTOM_FILE_IO__ -D__DF_BBBLUE -D__DF_BBBLUE_USE_RC_BMP280_IMP -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__PX4_POSIX_BBBLUE -D__STDC_FORMAT_MACROS -Dnoreturn_function=“attribute((noreturn))” -I…/…/boards/beaglebone/blue/src -I…/…/platforms/posix/src/px4/common/include -I. -Isrc -Isrc/lib -Isrc/modules -I…/…/platforms/posix/src/px4/generic/generic/include -I…/…/platforms/common/include -I…/…/src -I…/…/src/include -I…/…/src/lib -I…/…/src/lib/DriverFramework/framework/include -I…/…/src/lib/matrix -I…/…/src/modules -I…/…/src/platforms -I…/…/platforms/posix/include -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -I/include -std=gnu++11 -MD -MT src/lib/DriverFramework/framework/src/CMakeFiles/df_driver_framework.dir/DevObj.cpp.o -MF src/lib/DriverFramework/framework/src/CMakeFiles/df_driver_framework.dir/DevObj.cpp.o.d -o src/lib/DriverFramework/framework/src/CMakeFiles/df_driver_framework.dir/DevObj.cpp.o -c …/…/src/lib/DriverFramework/framework/src/DevObj.cpp
In file included from c:\px4\toolchain\cygwin64\opt\bbblue_toolchain\gcc-arm-linux-gnueabihf\gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf\arm-linux-gnueabihf\include\c++\7.5.0\cstdlib:41:0,
from c:\px4\toolchain\cygwin64\opt\bbblue_toolchain\gcc-arm-linux-gnueabihf\gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf\arm-linux-gnueabihf\include\c++\7.5.0\stdlib.h:36,
from …/…/src/include/visibility.h:72,
from :0:
c:\px4\toolchain\cygwin64\opt\bbblue_toolchain\gcc-arm-linux-gnueabihf\gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf\arm-linux-gnueabihf\include\c++\7.5.0\arm-linux-gnueabihf\bits\c++config.h:536:10: fatal error: bits/cpu_defines.h: No such file or directory
#include <bits/cpu_defines.h>
^~~~~~~~~~~~~~~~~~~~
compilation terminated.
[6/745] Generating uORB topic headers
ninja: build stopped: subcommand failed.
make: *** [Makefile:195 : beaglebone_blue_cross] Erreur 1

Can you also try master?

Hi Julian,
I moved some files here and there and got now a new error.
I remind you I am on Firware v1.10.2:

[3/589] Building CXX object src/lib/DriverFramework/drivers/bmp280/CMakeFiles/df_bmp280.dir/BMP280.cpp.o
FAILED: src/lib/DriverFramework/drivers/bmp280/CMakeFiles/df_bmp280.dir/BMP280.cpp.o
/opt/bbblue_toolchain/gcc-arm-linux-gnueabihf/gcc-linaro-7.5.0-2019.12-i686-mingw32_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++.exe -DCONFIG_ARCH_BOARD_BEAGLEBONE_BLUE -DRC_AUTOPILOT_EXT -D__CUSTOM_FILE_IO__ -D__DF_BBBLUE -D__DF_BBBLUE_USE_RC_BMP280_IMP -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__PX4_POSIX_BBBLUE -D__STDC_FORMAT_MACROS -Dnoreturn_function=“attribute((noreturn))” -I…/…/boards/beaglebone/blue/src -I…/…/platforms/posix/src/px4/common/include -I. -Isrc -Isrc/lib -Isrc/modules -I…/…/platforms/posix/src/px4/generic/generic/include -I…/…/platforms/common/include -I…/…/src -I…/…/src/include -I…/…/src/lib -I…/…/src/lib/DriverFramework/framework/include -I…/…/src/lib/matrix -I…/…/src/modules -I…/…/src/platforms -I…/…/platforms/posix/include -I…/…/src/lib/DriverFramework/drivers/bmp280/…/…/framework/include -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -I/include -std=gnu++11 -MD -MT src/lib/DriverFramework/drivers/bmp280/CMakeFiles/df_bmp280.dir/BMP280.cpp.o -MF src/lib/DriverFramework/drivers/bmp280/CMakeFiles/df_bmp280.dir/BMP280.cpp.o.d -o src/lib/DriverFramework/drivers/bmp280/CMakeFiles/df_bmp280.dir/BMP280.cpp.o -c …/…/src/lib/DriverFramework/drivers/bmp280/BMP280.cpp
In file included from …/…/src/lib/DriverFramework/drivers/bmp280/BMP280.cpp:36:0:
…/…/src/lib/DriverFramework/drivers/bmp280/BMP280.hpp:39:10: fatal error: robotcontrol.h: No such file or directory
#include <robotcontrol.h>
^~~~~~~~~~~~~~~~
compilation terminated.
[6/589] Building CXX object src/lib/mixer/CMakeFiles/mixer.dir/mixer_group.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:195 : beaglebone_blue_cross] Erreur 1

As said, it’s probably broken for v1.10.2, please try master.

Hi Julian, I tried master but still face to a new compilation error (see below).
Is librobotcontrol included in PX4 Firmare or do I need to do something with it before compling PX4 ?

[13/822] Performing build step for ‘librobotcontrol’
FAILED: librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build
cd /cygdrive/c/PX4/home/Firmware/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-build && /usr/bin/cmake.exe -P /cygdrive/c/PX4/home/Firmware/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build-RelWithDebInfo.cmake && /usr/bin/cmake.exe -E touch /cygdrive/c/PX4/home/Firmware/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build
CMake Error at /cygdrive/c/PX4/home/Firmware/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build-RelWithDebInfo.cmake:49 (message):
Command failed: 1

‘/usr/bin/cmake.exe’ ‘–build’ ‘.’

See also

/cygdrive/c/PX4/home/Firmware/build/beaglebone_blue_default/librobotcontrol-prefix/src/librobotcontrol-stamp/librobotcontrol-build-*.log

[16/822] Generating git version header
ninja: build stopped: subcommand failed.
make: *** [Makefile:200 : beaglebone_blue_default] Erreur 1

Not sure. @dagar how does this work with librobotcontrol?