From c7acc2a99b7d9b135992706fb3626421545e48f7 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Tue, 27 Jun 2023 17:31:38 +0200 Subject: [PATCH] Add comment for the procedure of downloading device controller. --- update.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/update.cpp b/update.cpp index a22fc87..0d3b996 100644 --- a/update.cpp +++ b/update.cpp @@ -376,6 +376,38 @@ bool Update::downloadBinaryToDC(QString const &bFile) const { return true; } +/* + Using the DC bootloader: + 1 : bl_reboot() // send to application, want DC2 to reset (in order to start + // the bootloader) + 2 : bl_startBL(): // send within 4s after DC poewer-on, otherwise bl is left + 3 : bl_check(): // send command to verify if bl is up + 4 : bl_isUp(): // returns true if bl is up and running + + 5 : bl_sendAddress(blockNumber) + // send start address, nr of 64-byte block, start with 0 + // will be sent only for following block-numbers: + // 0, 1024, 2048, 3072 and 4096, so basically every 64kByte + // for other addresses nothing happens + + 6 : bl_wasSendingAddOK() + // return val: 0: no response by now + // 1: error + // 10: OK + + 7 : bl_sendDataBlock() + // send 64 byte from bin file + + 8 : bl_sendLastBlock() + // send this command after all data are transferred + + 9 : bl_wasSendingDataOK() + // return val: 0: no response by now + // 1: error + // 10: OK + + 10 : bl_stopBL() // leave bl and start (the new) application + */ bool Update::updateBinary(char const *fileToSendToDC) { qInfo() << "updating device controller binary" << fileToSendToDC; QFile fn(fileToSendToDC);