From 4642452ca3b85afbbdbbd79ce43b93e45ee14e30 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 23 Jun 2026 13:57:44 +1000 Subject: [PATCH] hwdef: make the IMU heater board-specific rather than via fmuv3 fmuv3.inc no longer enables HAL_HAVE_IMU_HEATER (and fmuv3-bdshot.inc, which now includes it, inherits that). Boards based on FMUv3 declare the IMU heater explicitly, so whether a board has a heater is recorded on the board itself rather than inherited. The fmuv3 / fmuv3-bdshot reference targets keep the heater in their own hwdef.dat. Boards which enable the heater but set no HAL_IMU_TEMP_DEFAULT (and do not set BRD_HEAT_TARG in defaults.parm) carry a comment querying whether they really have a heater. No functional change. --- libraries/AP_HAL_ChibiOS/hwdef/CUAV-Pixhack-v3/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/CubePurple/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/CubeSolo/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/PixSurveyA1/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M-bdshot/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-bdshot/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/fmuv2/hwdef.dat | 5 ++++- libraries/AP_HAL_ChibiOS/hwdef/fmuv3-bdshot/hwdef.dat | 3 +++ libraries/AP_HAL_ChibiOS/hwdef/fmuv3/fmuv3.inc | 4 ---- libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat | 3 +++ libraries/AP_HAL_ChibiOS/hwdef/mRoX21/hwdef.dat | 5 ++++- 13 files changed, 46 insertions(+), 14 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CUAV-Pixhack-v3/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CUAV-Pixhack-v3/hwdef.dat index 99497e032dd..b56325dd5ef 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CUAV-Pixhack-v3/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CUAV-Pixhack-v3/hwdef.dat @@ -1,3 +1,6 @@ -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 USE_BOOTLOADER_FROM_BOARD fmuv3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/hwdef.dat index 83b64c1eb68..284bdbd7be6 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeBlack/hwdef.dat @@ -2,7 +2,10 @@ # for The CUBE Black and the Cube Purple hardware # this is based on fmuv3, but with vendor specific USB IDs -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 # if the user has both isolated sensors enabled then force-enable the # non-isolated IMU regardless of parameter setting. This is done in diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubePurple/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubePurple/hwdef.dat index 62258868886..7bca12456cd 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubePurple/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubePurple/hwdef.dat @@ -2,7 +2,10 @@ # for The CUBE Black and the Cube Purple hardware # this is based on fmuv3, but with vendor specific USB IDs -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 # USB setup USB_VENDOR 0x2DAE # ONLY FOR USE BY HEX! NOBODY ELSE diff --git a/libraries/AP_HAL_ChibiOS/hwdef/CubeSolo/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/CubeSolo/hwdef.dat index 2fdc028dffb..ca5b35b7699 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/CubeSolo/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/CubeSolo/hwdef.dat @@ -3,7 +3,10 @@ # this is based on the FMUv3 hwdef, with Solo's required parameter defaults # do not use this hwdef for any other vehicle or configuration -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 define BOARD_TYPE_DEFAULT 3 # FMUv3 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/PixSurveyA1/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/PixSurveyA1/hwdef.dat index b534b7c47f5..d87e77b3373 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/PixSurveyA1/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/PixSurveyA1/hwdef.dat @@ -1,6 +1,9 @@ # hw definition file for processing by chibios_hwdef.py # for MFE-V3, based on fmuv3 -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# IMU heater +define HAL_HAVE_IMU_HEATER 1 APJ_BOARD_ID AP_HW_PixSurveyA1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M-bdshot/hwdef.dat index 9b56d31a809..4dc044ffe03 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-1M-bdshot/hwdef.dat @@ -2,7 +2,10 @@ # for Pixhawk1-1M, based on Pixhawk1 -include ../fmuv3-bdshot/hwdef.dat +include ../fmuv3-bdshot/fmuv3-bdshot.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 # define the IMU types to probe. You can list more IMUs than you # actually have. The syntax for IMU declarations is: diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-bdshot/hwdef.dat index 7695ff784ae..0befdd63663 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1-bdshot/hwdef.dat @@ -1,6 +1,9 @@ # hw definition file for processing by chibios_hwdef.py -include ../fmuv3-bdshot/hwdef.dat +include ../fmuv3-bdshot/fmuv3-bdshot.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 # define the IMU types to probe. You can list more IMUs than you # actually have. The syntax for IMU declarations is: diff --git a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1/hwdef.dat index 85a707b039c..8583e7fdf73 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/Pixhawk1/hwdef.dat @@ -1,7 +1,10 @@ # hw definition file for processing by chibios_hwdef.py # for pixhawk1, based on fmuv3 -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 # define the IMU types to probe. You can list more IMUs than you # actually have. The syntax for IMU declarations is: diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv2/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/fmuv2/hwdef.dat index d336bbb50b1..d0433873e1f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv2/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv2/hwdef.dat @@ -1,7 +1,10 @@ # FMUv2 build, same as fmuv3, but 1M flash to avoid hardware issue # with 2nd half of flash on early STM32F427 chips -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 FLASH_SIZE_KB 1024 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3-bdshot/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3-bdshot/hwdef.dat index 5d085a0c73d..434e79ad33d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3-bdshot/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3-bdshot/hwdef.dat @@ -6,3 +6,6 @@ # be shared by boards which are based on it but do not share all of its # hardware (eg. the presence of an IMU heater). include fmuv3-bdshot.inc + +# the FMUv3 reference board (Pixhawk2/Cube) has an IMU heater +define HAL_HAVE_IMU_HEATER 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/fmuv3.inc b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/fmuv3.inc index a958bce7fea..5df552448a1 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/fmuv3.inc +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/fmuv3.inc @@ -429,10 +429,6 @@ define HAL_HAVE_SAFETY_SWITCH 1 # Enable RAMTRON parameter storage. define HAL_WITH_RAMTRON 1 -# Setup for the possibility of an IMU heater since the pixhawk2 cube has -# an IMU heater. -define HAL_HAVE_IMU_HEATER 1 - # Enable FAT filesystem support (needs a microSD defined via SDIO). define HAL_OS_FATFS_IO 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat index 31dbef093f6..73e9a2fbe44 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/fmuv3/hwdef.dat @@ -5,3 +5,6 @@ # be shared by boards which are based on FMUv3 but do not share all of # its hardware (eg. the presence of an IMU heater). include fmuv3.inc + +# the FMUv3 reference board (Pixhawk2/Cube) has an IMU heater +define HAL_HAVE_IMU_HEATER 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/mRoX21/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/mRoX21/hwdef.dat index 4b3200d3bc3..6d0906e95d0 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/mRoX21/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/mRoX21/hwdef.dat @@ -1,7 +1,10 @@ # hw definition file for processing by chibios_hwdef.py for the # mRo X2.1 board. This is a fmuv3, with BRD_TYPE forced to 20 -include ../fmuv3/hwdef.dat +include ../fmuv3/fmuv3.inc + +# does this board really have an IMU heater? If so set HAL_IMU_TEMP_DEFAULT. +define HAL_HAVE_IMU_HEATER 1 define BOARD_TYPE_DEFAULT 20