diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py index 06271766b4..20be9c3a4d 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/chibios_hwdef.py @@ -1122,6 +1122,8 @@ def write_UART_config(f): num_uarts = len(devlist) if 'IOMCU_UART' in config: num_uarts -= 1 + if num_uarts > 8: + error("Exceeded max num UARTs of 8 (%u)" % num_uarts) f.write('#define HAL_UART_NUM_SERIAL_PORTS %u\n' % (num_uarts+num_empty_uarts))