From 6766395f4450a1c8c0513611dfbae3742ef3c6e5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Nov 2022 14:42:17 +0100 Subject: [PATCH] works, but SW updates hangs at 21504 bytes --- .../devicedefinitions/PlocSupervisorDefinitions.h | 9 ++++++--- linux/devices/ploc/PlocSupvUartMan.cpp | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h index 8c638c83..aad0a4c8 100644 --- a/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h +++ b/linux/devices/devicedefinitions/PlocSupervisorDefinitions.h @@ -1154,8 +1154,11 @@ class WriteMemory : public TcBase { } spParams.creator.setSeqFlags(seqFlags); spParams.creator.setSeqCount(sequenceCount); - initPacket(memoryId, startAddress, length, updateData); - auto res = checkSizeAndSerializeHeader(); + auto res = initPacket(memoryId, startAddress, length, updateData); + if (res != returnvalue::OK) { + return res; + } + res = checkSizeAndSerializeHeader(); if (res != returnvalue::OK) { return res; } @@ -1182,7 +1185,7 @@ class WriteMemory : public TcBase { if (result != returnvalue::OK) { return result; } - size_t serializedSize = 6; + size_t serializedSize = MIN_TMTC_LEN; SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize, SerializeIF::Endianness::BIG); SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize, diff --git a/linux/devices/ploc/PlocSupvUartMan.cpp b/linux/devices/ploc/PlocSupvUartMan.cpp index 955484e5..919ac2aa 100644 --- a/linux/devices/ploc/PlocSupvUartMan.cpp +++ b/linux/devices/ploc/PlocSupvUartMan.cpp @@ -429,7 +429,7 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() { update.bytesWritten); return result; } - result = handlePacketTransmissionNoReply(packet, 2000); + result = handlePacketTransmissionNoReply(packet, 5000); if (result != returnvalue::OK) { triggerEvent(WRITE_MEMORY_FAILED, buildProgParams1(progPercent, update.sequenceCount), update.bytesWritten); @@ -443,7 +443,7 @@ ReturnValue_t PlocSupvUartManager::writeUpdatePackets() { #if OBSW_DEBUG_PLOC_SUPERVISOR == 1 progressPrinter.print(update.bytesWritten); #endif /* OBSW_DEBUG_PLOC_SUPERVISOR == 1 */ - TaskFactory::delayTask(1); + // TaskFactory::delayTask(1); } return result; }