diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 6552630754..6b1275bf00 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1524,7 +1524,9 @@ INCLUDE common.ld if t.startswith('SPI'): self.spi_list.append(t) self.spi_list = sorted(self.spi_list) - if len(self.spi_list) == 0: + if len(self.spidev) != 0 and len(self.spi_list) == 0: + self.error("Have SPI devices but no SPI bus?!") + if len(self.spidev) == 0: f.write('#define HAL_USE_SPI FALSE\n') return devlist = []