From 15200eafd89205b78440f4edcc7614084c6ff47e Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Tue, 11 Feb 2014 12:38:55 +0100 Subject: [PATCH 1/2] OP-974 add bootloader revision info in FirmwareIAP --- flight/modules/FirmwareIAP/firmwareiap.c | 2 ++ shared/uavobjectdefinition/firmwareiapobj.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/flight/modules/FirmwareIAP/firmwareiap.c b/flight/modules/FirmwareIAP/firmwareiap.c index 8c425f699..e1406daec 100644 --- a/flight/modules/FirmwareIAP/firmwareiap.c +++ b/flight/modules/FirmwareIAP/firmwareiap.c @@ -100,6 +100,7 @@ int32_t FirmwareIAPInitialize() PIOS_BL_HELPER_FLASH_Read_Description(data.Description, FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM); PIOS_SYS_SerialNumberGetBinary(data.CPUSerial); data.BoardRevision = bdinfo->board_rev; + data.BootloaderRevision = bdinfo->bl_rev; data.ArmReset = 0; data.crc = 0; FirmwareIAPObjSet(&data); @@ -147,6 +148,7 @@ static void FirmwareIAPCallback(UAVObjEvent *ev) PIOS_BL_HELPER_FLASH_Read_Description(data.Description, FIRMWAREIAPOBJ_DESCRIPTION_NUMELEM); PIOS_SYS_SerialNumberGetBinary(data.CPUSerial); data.BoardRevision = bdinfo->board_rev; + data.BootloaderRevision = bdinfo->bl_rev; data.crc = PIOS_BL_HELPER_CRC_Memory_Calc(); FirmwareIAPObjSet(&data); } diff --git a/shared/uavobjectdefinition/firmwareiapobj.xml b/shared/uavobjectdefinition/firmwareiapobj.xml index f83c8aa67..9de8abd3e 100644 --- a/shared/uavobjectdefinition/firmwareiapobj.xml +++ b/shared/uavobjectdefinition/firmwareiapobj.xml @@ -6,6 +6,7 @@ + From 7640f72e1f75ed2a716b4494918c7c0f005b84ba Mon Sep 17 00:00:00 2001 From: Alessio Morale Date: Sat, 15 Feb 2014 12:42:22 +0100 Subject: [PATCH 2/2] OP-974 add bootloader revision info in Uploader gadget's Device Information. --- .../plugins/uavobjectutil/uavobjectutilmanager.cpp | 9 +++++++++ .../plugins/uavobjectutil/uavobjectutilmanager.h | 1 + .../src/plugins/uploader/runningdevicewidget.cpp | 3 ++- .../src/plugins/uploader/runningdevicewidget.ui | 13 +++++++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index 74ddae50f..c15d743a0 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -263,6 +263,15 @@ int UAVObjectUtilManager::getBoardModel() return ret; } +int UAVObjectUtilManager::getBootloaderRevision() +{ + FirmwareIAPObj::DataFields firmwareIapData = getFirmwareIap(); + + int ret = firmwareIapData.BootloaderRevision; + + return ret; +} + /** * Get the UAV Board CPU Serial Number, for anyone interested. Return format is a byte array */ diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h index a89e241f7..e8279e93e 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h @@ -58,6 +58,7 @@ public: int getGPSPositionSensor(double LLA[3]); int getBoardModel(); + int getBootloaderRevision(); QByteArray getBoardCPUSerial(); quint32 getFirmwareCRC(); QByteArray getBoardDescription(); diff --git a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp index b433f9641..26116eae2 100644 --- a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.cpp @@ -99,8 +99,9 @@ void RunningDeviceWidget::populate() QString serial = utilMngr->getBoardCPUSerial().toHex(); myDevice->CPUSerial->setText(serial); - + myDevice->lblBLRev->setText(tr("BL version: ") + QString::number(utilMngr->getBootloaderRevision())); QByteArray description = utilMngr->getBoardDescription(); + deviceDescriptorStruct devDesc; if (UAVObjectUtilManager::descriptionToStructure(description, devDesc)) { if (devDesc.gitTag.startsWith("RELEASE", Qt::CaseSensitive)) { diff --git a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui index 05f5b7eaf..66f920795 100644 --- a/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui +++ b/ground/openpilotgcs/src/plugins/uploader/runningdevicewidget.ui @@ -95,6 +95,19 @@ + + + + + 0 + 0 + + + + BlRevision + + +