after dc-download, check if device-controller reboots successfully

This commit is contained in:
Gerhard Hoffmann 2025-08-25 13:55:49 +02:00
parent f415406672
commit f623b36421

View File

@ -450,16 +450,25 @@ int Update::run() {
qCritical() << "DownloadThread::run(): last result" << (int)sendStatus(m_hw->bl_wasSendingDataOK()); qCritical() << "DownloadThread::run(): last result" << (int)sendStatus(m_hw->bl_wasSendingDataOK());
#endif #endif
} }
// TODO
stopBootloader(); // there is no harm in stopping the bootloader even stopBootloader(); // there is no harm in stopping the bootloader even
// if starting the bootloader failed // if starting the bootloader failed
qInfo() << nextTimePoint().toUtf8().constData() << "<DC-UPDATE-SUCCESS>";
// check if update was successful
if (!m_debug) { if (!m_debug) {
m_hw->dc_autoRequest(true); //restart dc_autoRequest after download else E255! m_hw->dc_autoRequest(true); //restart dc_autoRequest after download else E255!
} }
return -(int)Result::SUCCESS; for (int i = 0; i < 3; ++i) {
qInfo() << "waiting for device controller restart...(" << i << ")";
QThread::sleep(20);
resetDeviceController();
if (startBootloader()) {
qInfo() << nextTimePoint().toUtf8().constData() << "<DC-UPDATE-SUCCESS>";
stopBootloader();
return -(int)Result::SUCCESS;
}
}
} }
qInfo() << nextTimePoint().toUtf8().constData() << "<DC-UPDATE-FAILURE>"; qInfo() << nextTimePoint().toUtf8().constData() << "<DC-UPDATE-FAILURE>";