diff --git a/QGCSetup.pri b/QGCSetup.pri index a44926f730c6ce928c3b69ea992f9be4cec915a6..63480efc15fe59c0715e2d115226beb5cfe358a4 100644 --- a/QGCSetup.pri +++ b/QGCSetup.pri @@ -122,7 +122,8 @@ LinuxBuild { libQt5Svg.so.5 \ libQt5Test.so.5 \ libQt5Widgets.so.5 \ - libQt5XcbQpa.so.5 + libQt5XcbQpa.so.5 \ + libQt5TextToSpeech.so.5 !contains(DEFINES, __rasp_pi2__) { QT_LIB_LIST += \ diff --git a/src/VehicleSetup/FirmwareImage.cc b/src/VehicleSetup/FirmwareImage.cc index 782ef70cb8a5136484fa5062461a2231f8e5e11f..0bc3c928801e68c07f669a45b9a816a39810a1a7 100644 --- a/src/VehicleSetup/FirmwareImage.cc +++ b/src/VehicleSetup/FirmwareImage.cc @@ -194,6 +194,24 @@ bool FirmwareImage::_ihxLoad(const QString& ihxFilename) return true; } +bool FirmwareImage::isCompatible(uint32_t boardId, uint32_t firmwareId) { + bool result = false; + if (boardId == firmwareId ) { + result = true; + } + switch(boardId) { + case Bootloader::boardIDAUAVX2_1: // AUAVX2.1 is compatible with px4-v2/v3 + if (firmwareId == 9) result = true; + break; + case Bootloader::boardIDPX4FMUV3: + if (firmwareId == 9) result = true; + break; + default: + break; + } + return result; +} + bool FirmwareImage::_px4Load(const QString& imageFilename) { _imageSize = 0; @@ -237,8 +255,7 @@ bool FirmwareImage::_px4Load(const QString& imageFilename) } uint32_t firmwareBoardId = (uint32_t)px4Json.value(_jsonBoardIdKey).toInt(); - uint32_t actualBoardId = _boardId == Bootloader::boardIDPX4FMUV3 ? Bootloader::boardIDPX4FMUV2 : _boardId;; - if (firmwareBoardId != actualBoardId) { + if (!isCompatible(_boardId, firmwareBoardId)) { emit statusMessage(QString("Downloaded firmware board id does not match hardware board id: %1 != %2").arg(firmwareBoardId).arg(_boardId)); return false; } diff --git a/src/VehicleSetup/FirmwareImage.h b/src/VehicleSetup/FirmwareImage.h index f567b266d2fe145becf0315b437a578eb864152b..5a9935dda0625c901e88567a8f48a7a73cba6e74 100644 --- a/src/VehicleSetup/FirmwareImage.h +++ b/src/VehicleSetup/FirmwareImage.h @@ -56,6 +56,9 @@ public: /// @return true: block retrieved bool ihxGetBlock(uint16_t index, uint16_t& address, QByteArray& bytes) const; + /// @return true: actual boardId is compatible with firmware boardId + bool isCompatible(uint32_t boardId, uint32_t firmwareId); + signals: void errorMessage(const QString& errorString); void statusMessage(const QString& warningtring); diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index b2f456f60dc2617dd98a94507f06e252d62e8cdc..b2ea5d72fe350a59709e28b1c585e069729dd718 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -324,6 +324,21 @@ void FirmwareUpgradeController::_initFirmwareHash() { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/auav-x21_default.px4"}, { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/auav-x21_default.px4"}, { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/auav-x21_default.px4"}, + { AutoPilotStackAPM, StableFirmware, CopterFirmware, "http://firmware.ardupilot.org/Copter/stable/PX4/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, StableFirmware, HeliFirmware, "http://firmware.ardupilot.org/Copter/stable/PX4-heli/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, StableFirmware, PlaneFirmware, "http://firmware.ardupilot.org/Plane/stable/PX4/ArduPlane-v2.px4"}, + { AutoPilotStackAPM, StableFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/stable/PX4/APMrover2-v2.px4"}, + { AutoPilotStackAPM, StableFirmware, SubFirmware, "http://firmware.ardupilot.org/Sub/stable/PX4/ArduSub-v2.px4"}, + { AutoPilotStackAPM, BetaFirmware, CopterFirmware, "http://firmware.ardupilot.org/Copter/beta/PX4/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, BetaFirmware, HeliFirmware, "http://firmware.ardupilot.org/Copter/beta/PX4-heli/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, BetaFirmware, PlaneFirmware, "http://firmware.ardupilot.org/Plane/beta/PX4/ArduPlane-v3.px4"}, + { AutoPilotStackAPM, BetaFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/beta/PX4/APMrover2-v3.px4"}, + { AutoPilotStackAPM, BetaFirmware, SubFirmware, "http://firmware.ardupilot.org/Sub/beta/PX4/ArduSub-v3.px4"}, + { AutoPilotStackAPM, DeveloperFirmware, CopterFirmware, "http://firmware.ardupilot.org/Copter/latest/PX4/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, DeveloperFirmware, HeliFirmware, "http://firmware.ardupilot.org/Copter/latest/PX4-heli/ArduCopter-v3.px4"}, + { AutoPilotStackAPM, DeveloperFirmware, PlaneFirmware, "http://firmware.ardupilot.org/Plane/latest/PX4/ArduPlane-v3.px4"}, + { AutoPilotStackAPM, DeveloperFirmware, RoverFirmware, "http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v3.px4"}, + { AutoPilotStackAPM, DeveloperFirmware, SubFirmware, "http://firmware.ardupilot.org/Sub/latest/PX4/ArduSub-v3.px4"} }; //////////////////////////////////// MindPXFMUV2 firmwares ////////////////////////////////////////////////// FirmwareToUrlElement_t rgMindPXFMUV2FirmwareArray[] = {