From 5c469a36b86c54e46f27786ed86c0b8313abb596 Mon Sep 17 00:00:00 2001 From: Jacob Dahl <37091262+dakejahl@users.noreply.github.com> Date: Wed, 19 Nov 2025 09:58:58 -0900 Subject: [PATCH] drivers: bootloaders: specify UAVCAN only in KConfig (#25947) --- src/drivers/bootloaders/CMakeLists.txt | 11 +++++++++++ src/drivers/bootloaders/Kconfig | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/drivers/bootloaders/CMakeLists.txt b/src/drivers/bootloaders/CMakeLists.txt index 0972160fdf..3123ea9d54 100644 --- a/src/drivers/bootloaders/CMakeLists.txt +++ b/src/drivers/bootloaders/CMakeLists.txt @@ -43,6 +43,17 @@ target_link_libraries(drivers_bootloaders PRIVATE crc) # generate bootloader_app_shared_t if(NOT "${PX4_BOARD_LABEL}" MATCHES "canbootloader") + # Check if UAVCAN board identity variables are defined + # These are only set for UAVCAN node boards (CAN peripherals like can-gps, cannode, etc.) + if(NOT DEFINED uavcanblid_hw_version_major OR NOT DEFINED uavcanblid_hw_version_minor OR + NOT DEFINED uavcanblid_sw_version_major OR NOT DEFINED uavcanblid_sw_version_minor) + message(FATAL_ERROR + "CONFIG_DRIVERS_BOOTLOADERS is only supported on UAVCAN node boards.\n" + "This board (${PX4_BOARD}) does not have UAVCAN board identity defined.\n" + "Please disable CONFIG_DRIVERS_BOOTLOADERS in boardconfig (make ${PX4_CONFIG} boardconfig).\n" + "Note: This option is only needed for CAN peripheral boards (e.g., can-gps, cannode, can-flow).") + endif() + set(HW_MAJOR ${uavcanblid_hw_version_major}) set(HW_MINOR ${uavcanblid_hw_version_minor}) set(SW_MAJOR ${uavcanblid_sw_version_major}) diff --git a/src/drivers/bootloaders/Kconfig b/src/drivers/bootloaders/Kconfig index a630d51277..4d75c553e4 100644 --- a/src/drivers/bootloaders/Kconfig +++ b/src/drivers/bootloaders/Kconfig @@ -1,5 +1,7 @@ menuconfig DRIVERS_BOOTLOADERS bool "bootloaders" default n + depends on BOARD_ROMFSROOT = "cannode" || BOARD_ROMFSROOT = "" ---help--- Enable support for bootloaders + Note: This is only supported on UAVCAN node boards (CAN peripherals)