From f623b364212fed09be42dd1d4ee2648399bd1812 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Mon, 25 Aug 2025 13:55:49 +0200 Subject: [PATCH] after dc-download, check if device-controller reboots successfully --- DownloadDCFirmware/update.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/DownloadDCFirmware/update.cpp b/DownloadDCFirmware/update.cpp index 71e73c7..a082925 100644 --- a/DownloadDCFirmware/update.cpp +++ b/DownloadDCFirmware/update.cpp @@ -450,16 +450,25 @@ int Update::run() { qCritical() << "DownloadThread::run(): last result" << (int)sendStatus(m_hw->bl_wasSendingDataOK()); #endif } - // TODO stopBootloader(); // there is no harm in stopping the bootloader even // if starting the bootloader failed - qInfo() << nextTimePoint().toUtf8().constData() << ""; + // check if update was successful if (!m_debug) { 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() << ""; + stopBootloader(); + return -(int)Result::SUCCESS; + } + } } qInfo() << nextTimePoint().toUtf8().constData() << "";