Commit 75c306a2 authored by Don Gagne's avatar Don Gagne

Merge pull request #2580 from DonLakeFlyer/RadioFlash

Fix RadioFlash
parents e8f7c3a1 09a3dc28
......@@ -273,7 +273,7 @@ bool Bootloader::_ihxProgram(QextSerialPort* port, const FirmwareImage* image)
return false;
}
qCDebug(FirmwareUpgradeVerboseLog) << QString("Bootloader::_ihxProgram - address:%1 size:%2 block:%3").arg(flashAddress).arg(bytes.count()).arg(index);
qCDebug(FirmwareUpgradeVerboseLog) << QString("Bootloader::_ihxProgram - address:0x%1 size:%2 block:%3").arg(flashAddress, 8, 16, QLatin1Char('0')).arg(bytes.count()).arg(index);
// Set flash address
......@@ -400,7 +400,7 @@ bool Bootloader::_binVerifyBytes(QextSerialPort* port, const FirmwareImage* imag
_write(port, (uint8_t)bytesToRead) &&
_write(port, PROTO_EOC)) {
port->flush();
if (_read(port, readBuf, sizeof(readBuf))) {
if (_read(port, readBuf, bytesToRead)) {
if (_getCommandResponse(port)) {
failed = false;
}
......
......@@ -135,7 +135,7 @@ private:
INFO_FLASH_SIZE = 4, ///< max firmware size in bytes
PROG_MULTI_MAX = 64, ///< write size for PROTO_PROG_MULTI, must be multiple of 4
READ_MULTI_MAX = 255 ///< read size for PROTO_READ_MULTI, must be multiple of 4
READ_MULTI_MAX = 0x28 ///< read size for PROTO_READ_MULTI, must be multiple of 4. Sik Radio max size is 0x28
};
uint32_t _boardID; ///< board id for currently connected board
......
......@@ -165,7 +165,8 @@ bool FirmwareImage::_ihxLoad(const QString& ihxFilename)
if (appendToLastBlock) {
_ihxBlocks[_ihxBlocks.count() - 1].bytes += bytes;
qCDebug(FirmwareUpgradeVerboseLog) << QString("_ihxLoad - append - address:%1 size:%2 block:%3").arg(address).arg(blockByteCount).arg(ihxBlockCount());
// Too noisy even for verbose
//qCDebug(FirmwareUpgradeVerboseLog) << QString("_ihxLoad - append - address:%1 size:%2 block:%3").arg(address).arg(blockByteCount).arg(ihxBlockCount());
} else {
IntelHexBlock_t block;
......
......@@ -95,7 +95,7 @@ void PX4FirmwareUpgradeThreadWorker::_startFindBoardLoop(void)
void PX4FirmwareUpgradeThreadWorker::_findBoardOnce(void)
{
qCDebug(FirmwareUpgradeLog) << "_findBoardOnce";
qCDebug(FirmwareUpgradeVerboseLog) << "_findBoardOnce";
QGCSerialPortInfo portInfo;
QGCSerialPortInfo::BoardType_t boardType;
......@@ -200,8 +200,8 @@ void PX4FirmwareUpgradeThreadWorker::_3drRadioForceBootloader(const QGCSerialPor
emit error("Unable to reboot radio (ready read)");
return;
}
QGC::SLEEP::msleep(700);
port.close();
QGC::SLEEP::msleep(2000);
// The bootloader should be waiting for us now
......@@ -232,6 +232,10 @@ bool PX4FirmwareUpgradeThreadWorker::_findBootloader(const QGCSerialPortInfo& po
}
}
if (radioMode) {
QGC::SLEEP::msleep(2000);
}
if (_bootloader->sync(_bootloaderPort)) {
bool success;
......
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