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;

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.

[PX4 Docker Containers | PX4 Guide (main)](Helper Script (docker_run.sh))

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.

[GIT 示例 | PX4 Guide (main)]( Get a Release Branch)

How do I solve this problem so that the firmware of px4_fmu-v2_default can be successfully compiled using v1.15.0?

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

Hey,

I think it should be ok if you pull 1.15.2. Also try with main.

Instead of compiling it yourself, you can use the existing compiled firmware from the following link

https://github.com/PX4/PX4-Autopilot/releases/download/v1.15.0/px4_fmu-v2_default.px4

This one is for the v1.15.0 that you want.

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

I’ve tried, but it still doesn’t work. Thank you for your reply :smiley:

I need to make changes to the source code, this method is not very suitable for me, thank you anyway :wink:

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.