From ff07d06f3701e3076cd5feefd200ec6fc38c2b2c Mon Sep 17 00:00:00 2001 From: Travis Bottalico Date: Wed, 4 Dec 2019 11:36:35 -0800 Subject: [PATCH] Add support for ModalAI FC v1 FW Update --- src/VehicleSetup/Bootloader.h | 1 + src/VehicleSetup/FirmwareUpgradeController.cc | 17 +++++++++++++++++ src/VehicleSetup/FirmwareUpgradeController.h | 1 + src/comm/USBBoardInfo.json | 1 + 4 files changed, 20 insertions(+) diff --git a/src/VehicleSetup/Bootloader.h b/src/VehicleSetup/Bootloader.h index 7a175f170..10f0082ec 100644 --- a/src/VehicleSetup/Bootloader.h +++ b/src/VehicleSetup/Bootloader.h @@ -78,6 +78,7 @@ public: static const int boardIDFMUK66V3 = 28; ///< FMUK66V3 board, as from USB PID static const int boardIDKakuteF7 = 123; ///< Holybro KakuteF7 board, as from USB PID static const int boardIDDurandalV1 = 139; ///< Holybro Durandal-v1 board, as from USB PID + static const int boardIDModalFCV1 = 41775; ///< ModalAI FC V1 board, as from USB PID /// Simulated board id for V3 which is a V2 board which supports larger flash space /// IMPORTANT: Make sure this id does not conflict with any newly added real board ids diff --git a/src/VehicleSetup/FirmwareUpgradeController.cc b/src/VehicleSetup/FirmwareUpgradeController.cc index 5f6c39a7a..3cb948676 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.cc +++ b/src/VehicleSetup/FirmwareUpgradeController.cc @@ -325,6 +325,14 @@ void FirmwareUpgradeController::_initFirmwareHash() { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/holybro_durandal-v1_default.px4"}, { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/holybro_durandal-v1_default.px4"}, }; + + //////////////////////////////////// ModalAI FC v1 firmwares ////////////////////////////////////////////////// + FirmwareToUrlElement_t rgModalFCV1FirmwareArray[] = { + { AutoPilotStackPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/stable/modalai_fc-v1_default.px4"}, + { AutoPilotStackPX4, BetaFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/beta/modalai_fc-v1_default.px4"}, + { AutoPilotStackPX4, DeveloperFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Firmware/master/modalai_fc-v1_default.px4"}, + }; + /////////////////////////////// px4flow firmwares /////////////////////////////////////// FirmwareToUrlElement_t rgPX4FLowFirmwareArray[] = { { PX4FlowPX4, StableFirmware, DefaultVehicleFirmware, "http://px4-travis.s3.amazonaws.com/Flow/master/px4flow.px4" }, @@ -424,6 +432,12 @@ void FirmwareUpgradeController::_initFirmwareHash() _rgFMUK66V3Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); } + size = sizeof(rgModalFCV1FirmwareArray)/sizeof(rgModalFCV1FirmwareArray[0]); + for (int i = 0; i < size; i++) { + const FirmwareToUrlElement_t& element = rgModalFCV1FirmwareArray[i]; + _rgModalFCV1Firmware.insert(FirmwareIdentifier(element.stackType, element.firmwareType, element.vehicleType), element.url); + } + size = sizeof(rgPX4FLowFirmwareArray)/sizeof(rgPX4FLowFirmwareArray[0]); for (int i = 0; i < size; i++) { const FirmwareToUrlElement_t& element = rgPX4FLowFirmwareArray[i]; @@ -504,6 +518,9 @@ QHash* FirmwareUpgradeCo case Bootloader::boardIDFMUK66V3: _rgFirmwareDynamic = _rgFMUK66V3Firmware; break; + case Bootloader::boardIDModalFCV1: + _rgFirmwareDynamic = _rgModalFCV1Firmware; + break; case Bootloader::boardID3DRRadio: _rgFirmwareDynamic = _rg3DRRadioFirmware; break; diff --git a/src/VehicleSetup/FirmwareUpgradeController.h b/src/VehicleSetup/FirmwareUpgradeController.h index 5327010c9..04c4452b4 100644 --- a/src/VehicleSetup/FirmwareUpgradeController.h +++ b/src/VehicleSetup/FirmwareUpgradeController.h @@ -220,6 +220,7 @@ private: QHash _rgKakuteF7Firmware; QHash _rgDurandalV1Firmware; QHash _rgFMUK66V3Firmware; + QHash _rgModalFCV1Firmware; QHash _rgPX4FLowFirmware; QHash _rg3DRRadioFirmware; diff --git a/src/comm/USBBoardInfo.json b/src/comm/USBBoardInfo.json index dabcef325..c58602b74 100644 --- a/src/comm/USBBoardInfo.json +++ b/src/comm/USBBoardInfo.json @@ -20,6 +20,7 @@ { "vendorID": 9900, "productID": 22, "boardClass": "Pixhawk", "name": "Crazyflie 2" }, { "vendorID": 9900, "productID": 1, "boardClass": "Pixhawk", "name": "Omnibus F4 SD" }, { "vendorID": 8137, "productID": 28, "boardClass": "Pixhawk", "name": "PX4 FMUK66 v3.x" }, + { "vendorID": 1155, "productID": 41775, "boardClass": "Pixhawk", "name": "PX4 FMU ModalAI FCv1" }, { "vendorID": 1155, "productID": 22336, "boardClass": "Pixhawk", "name": "ArduPilot ChibiOS" }, { "vendorID": 4617, "productID": 22336, "boardClass": "Pixhawk", "name": "ArduPilot ChibiOS" }, -- 2.22.0