diff --git a/Tools/AP_Bootloader/AP_Bootloader.cpp b/Tools/AP_Bootloader/AP_Bootloader.cpp index b3b9caa5fd..79fdb759b0 100644 --- a/Tools/AP_Bootloader/AP_Bootloader.cpp +++ b/Tools/AP_Bootloader/AP_Bootloader.cpp @@ -134,6 +134,18 @@ int main(void) try_boot = false; led_set(LED_BAD_FW); } +#if AP_BOOTLOADER_NETWORK_ENABLED + if (ok == check_fw_result_t::CHECK_FW_OK) { + const auto *app_descriptor = get_app_descriptor(); + if (app_descriptor != nullptr) { + network.status_printf("Firmware OK: %ld.%ld.%lx\n", app_descriptor->version_major, + app_descriptor->version_minor, + app_descriptor->git_hash); + } + } else { + network.status_printf("Firmware Error: %d\n", (int)ok); + } +#endif #endif // AP_CHECK_FIRMWARE_ENABLED #ifndef BOOTLOADER_DEV_LIST else if (timeout == HAL_BOOTLOADER_TIMEOUT) { diff --git a/Tools/AP_Bootloader/network.h b/Tools/AP_Bootloader/network.h index f7f55eebeb..84daebd242 100644 --- a/Tools/AP_Bootloader/network.h +++ b/Tools/AP_Bootloader/network.h @@ -14,6 +14,7 @@ class BL_Network { public: void init(void); void save_comms_ip(void); + void status_printf(const char *fmt, ...); private: struct netif *thisif; @@ -53,7 +54,6 @@ private: HAL_Semaphore status_mtx; char bl_status[256]; - void status_printf(const char *fmt, ...); }; #endif // AP_BOOTLOADER_NETWORK_ENABLED diff --git a/libraries/AP_CheckFirmware/AP_CheckFirmware.cpp b/libraries/AP_CheckFirmware/AP_CheckFirmware.cpp index 0dce6f8103..7464e52787 100644 --- a/libraries/AP_CheckFirmware/AP_CheckFirmware.cpp +++ b/libraries/AP_CheckFirmware/AP_CheckFirmware.cpp @@ -78,7 +78,7 @@ static check_fw_result_t check_firmware_signature(const app_descriptor_signed *a /* check firmware CRC and board ID to see if it matches */ -static check_fw_result_t check_good_firmware_signed(void) +static check_fw_result_t check_good_firmware_signed() { const uint8_t sig[8] = AP_APP_DESCRIPTOR_SIGNATURE_SIGNED; const uint8_t *flash1 = (const uint8_t *)(FLASH_LOAD_ADDRESS + (FLASH_BOOTLOADER_LOAD_KB + APP_START_OFFSET_KB)*1024); @@ -130,7 +130,7 @@ static check_fw_result_t check_good_firmware_signed(void) check firmware CRC and board ID to see if it matches, using unsigned signature */ -static check_fw_result_t check_good_firmware_unsigned(void) +static check_fw_result_t check_good_firmware_unsigned() { const uint8_t sig[8] = AP_APP_DESCRIPTOR_SIGNATURE_UNSIGNED; const uint8_t *flash1 = (const uint8_t *)(FLASH_LOAD_ADDRESS + (FLASH_BOOTLOADER_LOAD_KB + APP_START_OFFSET_KB)*1024);