Commit 3e6b81a4 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #5095 from mavlink/pr-new-board-support

Add support for FMUv4PRO and FMUv5 boards
parents a93fec8d 6c45e7eb
......@@ -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) {
......
......@@ -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
......
......@@ -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<FirmwareUpgradeController::FirmwareIdentifier, QString>* 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:
......
......@@ -201,6 +201,8 @@ private:
QString _portDescription;
// firmware hashes
QHash<FirmwareIdentifier, QString> _rgPX4FMUV5Firmware;
QHash<FirmwareIdentifier, QString> _rgPX4FMUV4PROFirmware;
QHash<FirmwareIdentifier, QString> _rgPX4FMUV4Firmware;
QHash<FirmwareIdentifier, QString> _rgPX4FMUV2Firmware;
QHash<FirmwareIdentifier, QString> _rgAeroCoreFirmware;
......
......@@ -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" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment