I want to compile the firmware for px4_fmu-v2_default.
My system is ubuntu20.04
I followed the official documentation for px4.
git clone https://github.com/PX4/PX4-Autopilot.git --recursive bash ./PX4-Autopilot/Tools/setup/ubuntu.sh make px4_fmu-v2_default
This error occurred:
In file included from ../../src/drivers/gnss/septentrio/sbf/decoder.h:46, from ../../src/drivers/gnss/septentrio/sbf/decoder.cpp:42: ../../src/drivers/gnss/septentrio/sbf/messages.h:101:10: error: 'septentrio::sbf::Header::id_number' is too small to hold all values of 'enum class septentrio::sbf::BlockID' [-Werror] 101 | BlockID id_number: 13; | ^~~~~~~~~ compilation terminated due to -Wfatal-errors. cc1plus: all warnings being treated as errors
This error is reported even though I updated the gcc version to 10.5.0
Later, I used docker to compile according to the official documentation,and this error was still reported.
Whether using the official script assistant or downloading the px4 image from the official website, compiling in the docker container will report this error.
but when I pulled the v1.14 version according to the requirements of this link,it was compilable.
Hi @Yehn-an , This might not fix your problem, but I think I had a similar issue to you and it fixed mine.
Are you trying to clone/pull just the tag of v1.14 from github? If so, this sometimes does some funky stuff to the logic and you need to make a new tag. After you clone/pull enter the following
git tag <tag-name>
so for example you might just put
git tag v1.14-dev
If this helps, great, if not, maybe it will help someone else
Thank you for your reply. I used the following commands to retrieve the 1.14 firmware version and successfully compiled it. I retrieved the v1.15 version in the same way, but none of them compiled successfully.
cd PX4-Autopilot
make clean
make distclean
git fetch origin release/1.14
git checkout release/1.14
make submodulesclean
make px4_fmu-v2_default
According to the link “Get a Release Branch” > Blockquote
In case if you haven’t found the solution, here it is:
Just run this command bash ./PX4-Autopilot/Tools/setup/ubuntu.sh. It will update necessary components (you may need to reboot after that).
After that, use make to build the specific firmware. Make sure to delete the already present ‘build’ folder before building again.