Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
403fe3a2
Commit
403fe3a2
authored
Jun 10, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for V3 flashing
parent
d1c2f3fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
6 deletions
+57
-6
Bootloader.cc
src/VehicleSetup/Bootloader.cc
+7
-0
Bootloader.h
src/VehicleSetup/Bootloader.h
+12
-5
FirmwareUpgradeController.cc
src/VehicleSetup/FirmwareUpgradeController.cc
+37
-0
FirmwareUpgradeController.h
src/VehicleSetup/FirmwareUpgradeController.h
+1
-0
PX4FirmwareUpgradeThread.cc
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
+0
-1
No files found.
src/VehicleSetup/Bootloader.cc
View file @
403fe3a2
...
...
@@ -582,6 +582,13 @@ bool Bootloader::getPX4BoardInfo(QextSerialPort* port, uint32_t& bootloaderVersi
qWarning
()
<<
_errorString
;
goto
Error
;
}
// Older V2 boards have large flash space but silicon error which prevents it from being used. Bootloader v5 and above
// will correctly account/report for this. Older bootloaders will not. Newer V2 board which support larger flash space are
// reported as V3 board id.
if
(
_boardID
==
boardIDPX4FMUV2
&&
_bootloaderVersion
>=
_bootloaderVersionV2CorrectFlash
&&
_boardFlashSize
>
_flashSizeSmall
)
{
_boardID
=
boardIDPX4FMUV3
;
}
bootloaderVersion
=
_bootloaderVersion
;
boardID
=
_boardID
;
...
...
src/VehicleSetup/Bootloader.h
View file @
403fe3a2
...
...
@@ -74,6 +74,11 @@ public:
static
const
int
boardIDTAPV1
=
64
;
///< TAP V1 board, as from USB PID
static
const
int
boardIDASCV1
=
65
;
///< ASC V1 board, as from USB PID
static
const
int
boardIDCrazyflie2
=
12
;
///< Crazyflie 2.0 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
static
const
int
boardIDPX4FMUV3
=
255
;
signals:
/// @brief Signals progress indicator for long running bootloader utility routines
void
updateProgress
(
int
curr
,
int
total
);
...
...
@@ -141,11 +146,13 @@ private:
QString
_errorString
;
///< Last error
static
const
int
_eraseTimeout
=
20000
;
///< Msecs to wait for response from erase command
static
const
int
_rebootTimeout
=
10000
;
///< Msecs to wait for reboot command to cause serial port to disconnect
static
const
int
_verifyTimeout
=
5000
;
///< Msecs to wait for response to PROTO_GET_CRC command
static
const
int
_readTimout
=
2000
;
///< Msecs to wait for read bytes to become available
static
const
int
_responseTimeout
=
2000
;
///< Msecs to wait for command response bytes
static
const
int
_eraseTimeout
=
20000
;
///< Msecs to wait for response from erase command
static
const
int
_rebootTimeout
=
10000
;
///< Msecs to wait for reboot command to cause serial port to disconnect
static
const
int
_verifyTimeout
=
5000
;
///< Msecs to wait for response to PROTO_GET_CRC command
static
const
int
_readTimout
=
2000
;
///< Msecs to wait for read bytes to become available
static
const
int
_responseTimeout
=
2000
;
///< Msecs to wait for command response bytes
static
const
int
_flashSizeSmall
=
1032192
;
///< Flash size for boards with silicon error
static
const
int
_bootloaderVersionV2CorrectFlash
=
5
;
///< Anything below this bootloader version on V2 boards cannot trust flash size
};
#endif // PX4FirmwareUpgrade_H
src/VehicleSetup/FirmwareUpgradeController.cc
View file @
403fe3a2
...
...
@@ -231,6 +231,35 @@ void FirmwareUpgradeController::_initFirmwareHash()
{
SingleFirmwareMode
,
StableFirmware
,
DefaultVehicleFirmware
,
_singleFirmwareURL
},
};
//////////////////////////////////// PX4FMUV3 firmwares //////////////////////////////////////////////////
// Note: ArduPilot stable does not yet support V3 firmwares, so fall back to V2
FirmwareToUrlElement_t
rgPX4FMV3FirmwareArray
[]
=
{
{
AutoPilotStackPX4
,
StableFirmware
,
DefaultVehicleFirmware
,
"http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v2_default.px4"
},
{
AutoPilotStackPX4
,
BetaFirmware
,
DefaultVehicleFirmware
,
"http://px4-travis.s3.amazonaws.com/Firmware/beta/px4fmu-v2_default.px4"
},
{
AutoPilotStackPX4
,
DeveloperFirmware
,
DefaultVehicleFirmware
,
"http://px4-travis.s3.amazonaws.com/Firmware/master/px4fmu-v2_default.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
QuadFirmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-quad/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
X8Firmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-octa-quad/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
HexaFirmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-hexa/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
OctoFirmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-octa/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
YFirmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-tri/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
Y6Firmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-y6/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
HeliFirmware
,
"http://firmware.ardupilot.org/Copter/stable/PX4-heli/ArduCopter-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
PlaneFirmware
,
"http://firmware.ardupilot.org/Plane/stable/PX4/ArduPlane-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
RoverFirmware
,
"http://firmware.ardupilot.org/Rover/stable/PX4/APMrover2-v2.px4"
},
{
AutoPilotStackAPM
,
StableFirmware
,
SubFirmware
,
"http://firmware.ardupilot.org/Sub/stable/PX4/ArduSub-v2.px4"
},
{
AutoPilotStackAPM
,
BetaFirmware
,
CopterFirmware
,
"http://firmware.ardupilot.org/Copter/beta/PX4/ArduCopter-v3.px4"
},
{
AutoPilotStackAPM
,
BetaFirmware
,
HeliFirmware
,
"http://firmware.ardupilot.org/Copter/beta/PX4-heli/ArduCopter-v3.px4"
},
{
AutoPilotStackAPM
,
BetaFirmware
,
PlaneFirmware
,
"http://firmware.ardupilot.org/Plane/beta/PX4/ArduPlane-v3.px4"
},
{
AutoPilotStackAPM
,
BetaFirmware
,
RoverFirmware
,
"http://firmware.ardupilot.org/Rover/beta/PX4/APMrover2-v3.px4"
},
{
AutoPilotStackAPM
,
BetaFirmware
,
SubFirmware
,
"http://firmware.ardupilot.org/Sub/beta/PX4/ArduSub-v3.px4"
},
{
AutoPilotStackAPM
,
DeveloperFirmware
,
CopterFirmware
,
"http://firmware.ardupilot.org/Copter/latest/PX4/ArduCopter-v3.px4"
},
{
AutoPilotStackAPM
,
DeveloperFirmware
,
HeliFirmware
,
"http://firmware.ardupilot.org/Copter/latest/PX4-heli/ArduCopter-v3.px4"
},
{
AutoPilotStackAPM
,
DeveloperFirmware
,
PlaneFirmware
,
"http://firmware.ardupilot.org/Plane/latest/PX4/ArduPlane-v3.px4"
},
{
AutoPilotStackAPM
,
DeveloperFirmware
,
RoverFirmware
,
"http://firmware.ardupilot.org/Rover/latest/PX4/APMrover2-v3.px4"
},
{
AutoPilotStackAPM
,
DeveloperFirmware
,
SubFirmware
,
"http://firmware.ardupilot.org/Sub/latest/PX4/ArduSub-v3.px4"
},
{
SingleFirmwareMode
,
StableFirmware
,
DefaultVehicleFirmware
,
_singleFirmwareURL
},
};
//////////////////////////////////// PX4FMUV2 firmwares //////////////////////////////////////////////////
FirmwareToUrlElement_t
rgPX4FMV2FirmwareArray
[]
=
{
{
AutoPilotStackPX4
,
StableFirmware
,
DefaultVehicleFirmware
,
"http://px4-travis.s3.amazonaws.com/Firmware/stable/px4fmu-v2_default.px4"
},
...
...
@@ -373,6 +402,12 @@ void FirmwareUpgradeController::_initFirmwareHash()
_rgPX4FMUV4Firmware
.
insert
(
FirmwareIdentifier
(
element
.
stackType
,
element
.
firmwareType
,
element
.
vehicleType
),
element
.
url
);
}
size
=
sizeof
(
rgPX4FMV3FirmwareArray
)
/
sizeof
(
rgPX4FMV3FirmwareArray
[
0
]);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
const
FirmwareToUrlElement_t
&
element
=
rgPX4FMV3FirmwareArray
[
i
];
_rgPX4FMUV3Firmware
.
insert
(
FirmwareIdentifier
(
element
.
stackType
,
element
.
firmwareType
,
element
.
vehicleType
),
element
.
url
);
}
size
=
sizeof
(
rgPX4FMV2FirmwareArray
)
/
sizeof
(
rgPX4FMV2FirmwareArray
[
0
]);
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
const
FirmwareToUrlElement_t
&
element
=
rgPX4FMV2FirmwareArray
[
i
];
...
...
@@ -456,6 +491,8 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo
return
&
_rgPX4FLowFirmware
;
case
Bootloader
:
:
boardIDPX4FMUV2
:
return
&
_rgPX4FMUV2Firmware
;
case
Bootloader
:
:
boardIDPX4FMUV3
:
return
&
_rgPX4FMUV3Firmware
;
case
Bootloader
:
:
boardIDPX4FMUV4
:
return
&
_rgPX4FMUV4Firmware
;
case
Bootloader
:
:
boardIDPX4FMUV4PRO
:
...
...
src/VehicleSetup/FirmwareUpgradeController.h
View file @
403fe3a2
...
...
@@ -204,6 +204,7 @@ private:
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV5Firmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV4PROFirmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV4Firmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV3Firmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV2Firmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgAeroCoreFirmware
;
QHash
<
FirmwareIdentifier
,
QString
>
_rgPX4FMUV1Firmware
;
...
...
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
View file @
403fe3a2
...
...
@@ -205,7 +205,6 @@ bool PX4FirmwareUpgradeThreadWorker::_findBootloader(const QGCSerialPortInfo& po
uint32_t
bootloaderVersion
=
0
;
uint32_t
boardID
;
uint32_t
flashSize
=
0
;
_bootloaderPort
=
new
QextSerialPort
(
QextSerialPort
::
Polling
);
if
(
radioMode
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment