From 857d3391030a191241fca8c391713056f27cdd35 Mon Sep 17 00:00:00 2001 From: "Andrew C. Smith" Date: Wed, 8 Jul 2015 15:20:25 -0700 Subject: [PATCH] Add Gumstix AeroCore board support to firmware flashing. --- src/SerialPortIds.h | 2 ++ src/VehicleSetup/FirmwareUpgrade.qml | 4 ++-- src/VehicleSetup/FirmwareUpgradeController.cc | 19 ++++++++++++++++--- src/VehicleSetup/PX4FirmwareUpgradeThread.cc | 4 ++++ src/VehicleSetup/PX4FirmwareUpgradeThread.h | 3 ++- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/SerialPortIds.h b/src/SerialPortIds.h index f4f167ee0..a9613781b 100644 --- a/src/SerialPortIds.h +++ b/src/SerialPortIds.h @@ -32,6 +32,8 @@ public: static const int pixhawkFMUV2ProductId = 17; ///< Product ID for Pixhawk V2 board static const int pixhawkFMUV1ProductId = 16; ///< Product ID for PX4 FMU V1 board + + static const int AeroCoreProductId = 4097; ///< Product ID for the AeroCore board static const int px4FlowProductId = 21; ///< Product ID for PX4 Flow board diff --git a/src/VehicleSetup/FirmwareUpgrade.qml b/src/VehicleSetup/FirmwareUpgrade.qml index f4d5627d4..46cac9be5 100644 --- a/src/VehicleSetup/FirmwareUpgrade.qml +++ b/src/VehicleSetup/FirmwareUpgrade.qml @@ -96,7 +96,7 @@ QGCView { } else { // We end up here when we detect a board plugged in after we've started upgrade statusTextArea.append(highlightPrefix + "Found device" + highlightSuffix + ": " + controller.boardType) - if (controller.boardType == "Pixhawk") { + if (controller.boardType == "Pixhawk" || controller.boardType == "AeroCore") { showDialog(pixhawkFirmwareSelectDialog, title, 50, StandardButton.Ok | StandardButton.Cancel) } } @@ -367,4 +367,4 @@ QGCView { } } } // QGCViewPabel -} // QGCView \ No newline at end of file +} // QGCView diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index 4bece5b09..66992cdc3 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -94,6 +94,10 @@ void FirmwareUpgradeController::_foundBoard(bool firstAttempt, const QSerialPort _foundBoardType = "Pixhawk"; _startFlashWhenBootloaderFound = false; break; + case FoundBoardAeroCore: + _foundBoardType = "AeroCore"; + _startFlashWhenBootloaderFound = false; + break; case FoundBoardPX4Flow: case FoundBoard3drRadio: _foundBoardType = type == FoundBoardPX4Flow ? "PX4 Flow" : "3DR Radio"; @@ -167,9 +171,18 @@ void FirmwareUpgradeController::_getFirmwareFile(FirmwareType_t firmwareType) static const size_t crgPX4FMUV2Firmware = sizeof(rgPX4FMUV2Firmware) / sizeof(rgPX4FMUV2Firmware[0]); static const DownloadLocationByFirmwareType_t rgAeroCoreFirmware[] = { - { PX4StableFirmware, "http://s3-us-west-2.amazonaws.com/gumstix-aerocore/PX4/stable/aerocore_default.px4" }, - { PX4BetaFirmware, "http://s3-us-west-2.amazonaws.com/gumstix-aerocore/PX4/beta/aerocore_default.px4" }, - { PX4DeveloperFirmware, "http://s3-us-west-2.amazonaws.com/gumstix-aerocore/PX4/master/aerocore_default.px4" }, + { PX4StableFirmware, "http://gumstix-aerocore.s3.amazonaws.com/PX4/stable/aerocore_default.px4" }, + { PX4BetaFirmware, "http://gumstix-aerocore.s3.amazonaws.com/PX4/beta/aerocore_default.px4" }, + { PX4DeveloperFirmware, "http://gumstix-aerocore.s3.amazonaws.com/PX4/master/aerocore_default.px4" }, + { ApmArduCopterQuadFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-quad/ArduCopter-aerocore.px4" }, + { ApmArduCopterX8Firmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-octa-quad/ArduCopter-aerocore.px4" }, + { ApmArduCopterHexaFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-hexa/ArduCopter-aerocore.px4" }, + { ApmArduCopterOctoFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-octa/ArduCopter-aerocore.px4" }, + { ApmArduCopterYFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-tri/ArduCopter-aerocore.px4" }, + { ApmArduCopterY6Firmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-y6/ArduCopter-aerocore.px4" }, + { ApmArduCopterHeliFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Copter/stable/PX4-heli/ArduCopter-aerocore.px4" }, + { ApmArduPlaneFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Plane/stable/PX4/ArduPlane-aerocore.px4" }, + { ApmRoverFirmware, "http://gumstix-aerocore.s3.amazonaws.com/APM/Plane/stable/PX4/APMrover2-aerocore.px4" }, }; static const size_t crgAeroCoreFirmware = sizeof(rgAeroCoreFirmware) / sizeof(rgAeroCoreFirmware[0]); diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc index 484f3162f..31ecc42fb 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.cc +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.cc @@ -160,6 +160,10 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QSerialPortInfo& portIn qCDebug(FirmwareUpgradeLog) << "Found PX4 Flow"; type = FoundBoardPX4Flow; found = true; + } else if (info.productIdentifier() == SerialPortIds::AeroCoreProductId) { + qCDebug(FirmwareUpgradeLog) << "Found AeroCore"; + type = FoundBoardAeroCore; + found = true; } break; case SerialPortIds::threeDRRadioVendorId: diff --git a/src/VehicleSetup/PX4FirmwareUpgradeThread.h b/src/VehicleSetup/PX4FirmwareUpgradeThread.h index 23b35d221..927832606 100644 --- a/src/VehicleSetup/PX4FirmwareUpgradeThread.h +++ b/src/VehicleSetup/PX4FirmwareUpgradeThread.h @@ -45,7 +45,8 @@ typedef enum { FoundBoardPX4FMUV1, FoundBoardPX4FMUV2, FoundBoardPX4Flow, - FoundBoard3drRadio + FoundBoard3drRadio, + FoundBoardAeroCore } PX4FirmwareUpgradeFoundBoardType_t; class PX4FirmwareUpgradeThreadController; -- 2.22.0