diff --git a/src/VehicleSetup/Bootloader.cc b/src/VehicleSetup/Bootloader.cc index a023ab140fb547fb7eea91538f710c7a7b1b3f4c..0dfc3ee94b4a2f8630957846b88d84bf3f65f357 100644 --- a/src/VehicleSetup/Bootloader.cc +++ b/src/VehicleSetup/Bootloader.cc @@ -96,6 +96,9 @@ bool Bootloader::_getCommandResponse(QextSerialPort* port, int responseTimeout) if (response[0] != PROTO_INSYNC) { _errorString = tr("Invalid sync response: 0x%1 0x%2").arg(response[0], 2, 16, QLatin1Char('0')).arg(response[1], 2, 16, QLatin1Char('0')); return false; + } else if (response[0] == PROTO_INSYNC && response[1] == PROTO_BAD_SILICON_REV) { + _errorString = tr("This board is using a microcontroller with faulty silicon and an incorrect configuration and should be put out of service."); + return false; } else if (response[1] != PROTO_OK) { QString responseCode = tr("Unknown response code"); if (response[1] == PROTO_FAILED) { diff --git a/src/VehicleSetup/Bootloader.h b/src/VehicleSetup/Bootloader.h index 268132483a720f95d148e8856ee4ba2c16606147..9c37d9ce4d7c08915d5894b8954d5ca2ec6627e5 100644 --- a/src/VehicleSetup/Bootloader.h +++ b/src/VehicleSetup/Bootloader.h @@ -64,6 +64,8 @@ public: static const int boardIDPX4FMUV1 = 5; ///< PX4 V1 board, as from USB PID static const int boardIDPX4FMUV2 = 9; ///< PX4 V2 board, as from USB PID static const int boardIDPX4FMUV4 = 11; ///< PX4 V4 board, as from USB PID + static const int boardIDPX4FMUV4PRO = 13; ///< PX4 V4PRO board, as from USB PID + static const int boardIDPX4FMUV5 = 50; ///< PX4 V5 board, as from USB PID static const int boardIDPX4Flow = 6; ///< PX4 Flow board, as from USB PID static const int boardIDAeroCore = 98; ///< Gumstix AeroCore board, as from USB PID static const int boardIDAUAVX2_1 = 33; ///< AUAV X2.1 board, as from USB PID @@ -98,6 +100,7 @@ private: enum { // protocol bytes PROTO_INSYNC = 0x12, ///< 'in sync' byte sent before status + PROTO_BAD_SILICON_REV = 0x14, ///< device is using silicon not suitable for the target the bootloader was used for PROTO_EOC = 0x20, ///< end of command // Reply bytes diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index 0585302d9605e8c304dbb06e9ffae41ed4b146b4..a7160655ffb8fbb610b0fbabef7d760e090280fd 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -190,6 +190,22 @@ void FirmwareUpgradeController::_initFirmwareHash() return; } + //////////////////////////////////// PX4FMUV5 firmwares ////////////////////////////////////////////////// + FirmwareToUrlElement_t rgPX4FMV5FirmwareArray[] = { + { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v5_default.px4"}, + { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/px4fmu-v5_default.px4"}, + { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/px4fmu-v5_default.px4"}, + { SingleFirmwareMode,StableFirmware, DefaultVehicleFirmware, _singleFirmwareURL}, + }; + + //////////////////////////////////// PX4FMUV4PRO firmwares ////////////////////////////////////////////////// + FirmwareToUrlElement_t rgPX4FMV4PROFirmwareArray[] = { + { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v4pro_default.px4"}, + { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/px4fmu-v4pro_default.px4"}, + { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/px4fmu-v4pro_default.px4"}, + { SingleFirmwareMode,StableFirmware, DefaultVehicleFirmware, _singleFirmwareURL}, + }; + //////////////////////////////////// PX4FMUV4 firmwares ////////////////////////////////////////////////// FirmwareToUrlElement_t rgPX4FMV4FirmwareArray[] = { { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v4_default.px4"}, @@ -330,7 +346,19 @@ void FirmwareUpgradeController::_initFirmwareHash() }; // populate hashes now - int size = sizeof(rgPX4FMV4FirmwareArray)/sizeof(rgPX4FMV4FirmwareArray[0]); + int size = sizeof(rgPX4FMV5FirmwareArray)/sizeof(rgPX4FMV5FirmwareArray[0]); + for (int i = 0; i < size; i++) { + const FirmwareToUrlElement_t& element = rgPX4FMV5FirmwareArray[i]; + _rgPX4FMUV5Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } + + size = sizeof(rgPX4FMV4PROFirmwareArray)/sizeof(rgPX4FMV4PROFirmwareArray[0]); + for (int i = 0; i < size; i++) { + const FirmwareToUrlElement_t& element = rgPX4FMV4PROFirmwareArray[i]; + _rgPX4FMUV4PROFirmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } + + size = sizeof(rgPX4FMV4FirmwareArray)/sizeof(rgPX4FMV4FirmwareArray[0]); for (int i = 0; i < size; i++) { const FirmwareToUrlElement_t& element = rgPX4FMV4FirmwareArray[i]; _rgPX4FMUV4Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); @@ -415,6 +443,10 @@ QHash* FirmwareUpgradeCo return &_rgPX4FMUV2Firmware; case Bootloader::boardIDPX4FMUV4: return &_rgPX4FMUV4Firmware; + case Bootloader::boardIDPX4FMUV4PRO: + return &_rgPX4FMUV4PROFirmware; + case Bootloader::boardIDPX4FMUV5: + return &_rgPX4FMUV5Firmware; case Bootloader::boardIDAeroCore: return &_rgAeroCoreFirmware; case Bootloader::boardIDAUAVX2_1: diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 6ce335d6caa2a0eb561e34b161a111bf05322dd8..b6507e47a243c1b70780d0651cdd3ba53f2681ff 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -201,6 +201,8 @@ private: QString _portDescription; // firmware hashes + QHash _rgPX4FMUV5Firmware; + QHash _rgPX4FMUV4PROFirmware; QHash _rgPX4FMUV4Firmware; QHash _rgPX4FMUV2Firmware; QHash _rgAeroCoreFirmware; diff --git a/src/comm/USBBoardInfo.json b/src/comm/USBBoardInfo.json index 11465cbbb4e34f4275aed615f56ca2900d45d0a5..a71ed3b725200b797742a0a5a1cb008e24100655 100644 --- a/src/comm/USBBoardInfo.json +++ b/src/comm/USBBoardInfo.json @@ -9,10 +9,12 @@ { "vendorID": 9900, "productID": 16, "boardClass": "Pixhawk", "name": "PX4 FMU V1" }, { "vendorID": 9900, "productID": 17, "boardClass": "Pixhawk", "name": "PX4 FMU V2" }, { "vendorID": 9900, "productID": 18, "boardClass": "Pixhawk", "name": "PX4 FMU V4" }, + { "vendorID": 9900, "productID": 19, "boardClass": "Pixhawk", "name": "PX4 FMU V4 PRO" }, { "vendorID": 9900, "productID": 22, "boardClass": "Pixhawk", "name": "PX4 FMU V2", "comment": "Bootloader on older Pixhawk V2 boards" }, { "vendorID": 9900, "productID": 4097, "boardClass": "Pixhawk", "name": "AeroCore" }, { "vendorID": 9900, "productID": 33, "boardClass": "Pixhawk", "name": "AUAV X2.1 FMU V2" }, { "vendorID": 9900, "productID": 48, "boardClass": "Pixhawk", "name": "MindPX FMU V2" }, + { "vendorID": 9900, "productID": 50, "boardClass": "Pixhawk", "name": "PX4 FMU V5" }, { "vendorID": 9900, "productID": 64, "boardClass": "Pixhawk", "name": "TAP V1" }, { "vendorID": 9900, "productID": 65, "boardClass": "Pixhawk", "name": "ASC V1" }, @@ -30,6 +32,10 @@ ], "boardFallback": [ + { "regExp": "^PX4 FMU v5.x$", "boardClass": "Pixhawk" }, + { "regExp": "^PX4 BL FMU v5.x$","boardClass": "Pixhawk" }, + { "regExp": "^PX4 FMU v4.x PRO$", "boardClass": "Pixhawk" }, + { "regExp": "^PX4 BL FMU v4.x PRO$","boardClass": "Pixhawk" }, { "regExp": "^PX4 FMU v4.x$", "boardClass": "Pixhawk" }, { "regExp": "^PX4 BL FMU v4.x$", "boardClass": "Pixhawk" }, { "regExp": "^PX4 FMU v2.x$", "boardClass": "Pixhawk" },