ardupilot
ardupilot copied to clipboard
AP_HAL: hwdef: scripts: enforce use of board_types.txt - nix numeric IDs
f.write('#define APJ_BOARD_ID %s\n' % self.get_numeric_board_id())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pbarker/rc/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/scripts/../../../../libraries/AP_HAL/hwdef/scripts/hwdef.py", line 82, in get_numeric_board_id
raise ValueError("Numeric board ID found. Your APJ_BOARD_ID must not use a number. Change the number to be the name of the board used in Tools/AP_Bootloader/board_types.txt") # noqa:E501
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Numeric board ID found. Your APJ_BOARD_ID must not use a number. Change the number to be the name of the board used in Tools/AP_Bootloader/board_types.txt
Failed to process hwdef.dat ret=1
(complete log in /home/pbarker/rc/ardupilot/build/config.log)
pbarker@crun:~/rc/ardupilot(pr/no-numeric-board-ids)$
This is a no-compiler-output change PR.
Except for CubeRedSecondary-IO, in which scripting has been removed.
I like this
Output from size_compare_branches.py is as expected:
pbarker@threads:~$ ~/rc/ardupilot/Tools/scripts/filter_size_compare_branches_csv.py --hide-binary-identical /tmp/some.csv
---------------------------- ----- ---------- ------ ---- ----- ----- ---
Board blimp bootloader copter heli plane rover sub
ARK_FPV 8 * 8 8 8 8 8
ATOMRCF405NAVI-Deluxe 16 * 8 8 8 8 8
AnyleafH7 8 * 16 16 16 8 8
BROTHERHOBBYF405v3 16 * 16 16 16 16 16
CubeOrange 8 * 8 8 8 8 8
CubeOrange-ODID 8 * 0 0 8 0 8
CubeOrange-SimOnHardWare 8
CubeOrange-bdshot 8 * 8 8 8 8 8
CubeOrange-joey 0 * 0 0 0 0 0
CubeOrangePlus -8 * -8 -8 0 -8 0
CubeOrangePlus-ODID -8 * 0 -8 -8 0 -8
CubeOrangePlus-SimOnHardWare 0
CubeOrangePlus-bdshot 0 * 0 0 0 0 0
Pixhawk6C 24 * 16 24 24 24 16
Pixhawk6C-bdshot 16 * 16 16 16 16 16
---------------------------- ----- ---------- ------ ---- ----- ----- ---
pbarker@threads:~$
... noting that we don't put the board ID anywhere in the IOMCU firmwares, they were unchanged. Other changes here are just the hwdef.dat changes.
I have verified that CI will fail PRs that don't use numeric IDs by killing the changes to the BrotherHobbies boards:
Made the changes requested at DevCall - did away with the mapping from weird string to board ID for Pixhawk6C, and just modified the board type. I created a PR in the PX4-Bootloader repository to make the same change.
I've again confirmed there's no change to the build products for the IOMCUs.
configure-all still passes everything when I rebase this on master. Merging as agreed at DevCall.