ACS IMTQ Update #284

Merged
muellerr merged 8 commits from mueller/acs-imtq-update into develop 2022-08-24 16:56:52 +02:00
6 changed files with 46 additions and 39 deletions
Showing only changes of commit c8d38cf852 - Show all commits

View File

@ -370,8 +370,8 @@ class TcFlashWrite : public ploc::SpTcBase {
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
size_t serializedSize = 0;
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, sizeof(writeLen),
size_t serializedSize = ccsds::HEADER_LEN;
result = SerializeAdapter::serialize(&writeLen, payloadStart, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
@ -663,8 +663,8 @@ class TcCamcmdSend : public TcBase {
if (res != HasReturnvaluesIF::RETURN_OK) {
return res;
}
size_t size = sizeof(dataLen);
SerializeAdapter::serialize(&dataLen, payloadStart, &size, sizeof(dataLen),
size_t size = ccsds::HEADER_LEN;
SerializeAdapter::serialize(&dataLen, payloadStart, &size, spParams.maxSize,
SerializeIF::Endianness::BIG);
std::memcpy(payloadStart + sizeof(dataLen), commandData, commandDataLen);
*(payloadStart + sizeof(dataLen) + commandDataLen) = CARRIAGE_RETURN;

View File

@ -721,11 +721,11 @@ class SetAdcWindowAndStride : public ploc::SpTcBase {
static const uint16_t CRC_OFFSET = DATA_FIELD_LENGTH - 2;
void initPacket(uint16_t windowSize, uint16_t stridingStepSize) {
size_t serializedSize = 0;
size_t serializedSize = 6;
uint8_t* data = payloadStart;
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, sizeof(windowSize),
SerializeAdapter::serialize(&windowSize, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, sizeof(stridingStepSize),
SerializeAdapter::serialize(&stridingStepSize, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
}
};
@ -1066,13 +1066,13 @@ class CheckMemory : public ploc::SpTcBase {
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
uint8_t* data = payloadStart;
size_t serLen = 0;
SerializeAdapter::serialize(&memoryId, &data, &serLen, sizeof(memoryId),
size_t serLen = 6;
SerializeAdapter::serialize(&memoryId, &data, &serLen, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&n, &data, &serLen, sizeof(n), SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&startAddress, &data, &serLen, sizeof(startAddress),
SerializeAdapter::serialize(&n, &data, &serLen, spParams.maxSize, SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&startAddress, &data, &serLen, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&length, &data, &serLen, sizeof(length),
SerializeAdapter::serialize(&length, &data, &serLen, spParams.maxSize,
SerializeIF::Endianness::BIG);
}
};
@ -1119,7 +1119,6 @@ class WriteMemory : public ploc::SpTcBase {
ReturnValue_t initPacket(uint8_t memoryId, uint32_t startAddr, uint16_t updateDataLen,
uint8_t* updateData) {
size_t serializedSize = 0;
uint8_t* data = payloadStart;
if (updateDataLen % 2 != 0) {
spParams.setPayloadLen(META_DATA_LENGTH + updateDataLen + 1);
@ -1131,13 +1130,14 @@ class WriteMemory : public ploc::SpTcBase {
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
size_t serializedSize = 6;
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, sizeof(startAddr),
SerializeAdapter::serialize(&startAddr, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, sizeof(updateDataLen),
SerializeAdapter::serialize(&updateDataLen, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
std::memcpy(data, updateData, updateDataLen);
if (updateDataLen % 2 != 0) {
@ -1178,17 +1178,15 @@ class EraseMemory : public ploc::SpTcBase {
uint32_t length = 0;
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
size_t serializedSize = 0;
uint8_t* data = payloadStart;
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, sizeof(memoryId),
size_t serializedSize = 6;
SerializeAdapter::serialize(&memoryId, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
SerializeAdapter::serialize(&n, &data, &serializedSize, sizeof(n),
SerializeAdapter::serialize(&n, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
serializedSize = 0;
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, sizeof(startAddress),
SerializeAdapter::serialize(&startAddress, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
serializedSize = 0;
SerializeAdapter::serialize(&length, &data, &serializedSize, sizeof(length),
SerializeAdapter::serialize(&length, &data, &serializedSize, spParams.maxSize,
SerializeIF::Endianness::BIG);
}
};

View File

@ -161,26 +161,32 @@ void PlocSupvHelper::stopProcess() { terminate = true; }
ReturnValue_t PlocSupvHelper::performUpdate() {
ReturnValue_t result = RETURN_OK;
sif::info << "PlocSupvHelper::performUpdate: Calculating Image CRC" << std::endl;
result = calcImageCrc();
if (result != RETURN_OK) {
return result;
}
sif::info << "PlocSupvHelper::performUpdate: Selecting Memory" << std::endl;
result = selectMemory();
if (result != RETURN_OK) {
return result;
}
sif::info << "PlocSupvHelper::performUpdate: Preparing Update" << std::endl;
result = prepareUpdate();
if (result != RETURN_OK) {
return result;
}
sif::info << "PlocSupvHelper::performUpdate: Erasing Memory" << std::endl;
result = eraseMemory();
if (result != RETURN_OK) {
return result;
}
sif::info << "PlocSupvHelper::performUpdate: Writing Update Packets" << std::endl;
result = writeUpdatePackets();
if (result != RETURN_OK) {
return result;
}
sif::info << "PlocSupvHelper::performUpdate: Memory Check" << std::endl;
result = handleCheckMemoryCommand();
if (result != RETURN_OK) {
return result;
@ -317,6 +323,9 @@ ReturnValue_t PlocSupvHelper::prepareUpdate() {
resetSpParams();
supv::ApidOnlyPacket packet(spParams, supv::APID_PREPARE_UPDATE);
result = packet.buildPacket();
if (result != RETURN_OK) {
return result;
}
result = handlePacketTransmission(packet, PREPARE_UPDATE_EXECUTION_REPORT);
if (result != RETURN_OK) {
return result;

View File

@ -178,11 +178,11 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
#ifdef XIPHOS_Q7S
SdCardManager* sdcMan = nullptr;
#endif
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE];
uint8_t commandBuffer[supv::MAX_COMMAND_SIZE]{};
SpacePacketCreator creator;
ploc::SpTcParams spParams = ploc::SpTcParams(creator);
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf;
std::array<uint8_t, supv::MAX_COMMAND_SIZE> tmBuf{};
bool terminate = false;

View File

@ -785,30 +785,30 @@ void IMTQHandler::fillRawMtmDataset(const uint8_t* packet) {
int32_t yRaw = 0;
int32_t zRaw = 0;
uint32_t coilActStatus = 0;
auto res = SerializeAdapter::deSerialize(&xRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
auto res =
SerializeAdapter::deSerialize(&xRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
if (res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&yRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
res =
SerializeAdapter::deSerialize(&yRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
if (res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&zRaw, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
res =
SerializeAdapter::deSerialize(&zRaw, &dataStart, &deSerLen, SerializeIF::Endianness::LITTLE);
if (res != HasReturnvaluesIF::RETURN_OK) {
return;
}
res = SerializeAdapter::deSerialize(&coilActStatus, &dataStart, &deSerLen,
SerializeIF::Endianness::LITTLE);
if(res != HasReturnvaluesIF::RETURN_OK) {
SerializeIF::Endianness::LITTLE);
if (res != HasReturnvaluesIF::RETURN_OK) {
return;
}
rawMtmMeasurementSet.mtmRawNt[0] = xRaw * 7.5;
rawMtmMeasurementSet.mtmRawNt[1] = yRaw * 7.5;
rawMtmMeasurementSet.mtmRawNt[2] = zRaw * 7.5;
rawMtmMeasurementSet.coilActuationStatus = static_cast<uint8_t>(coilActStatus);
rawMtmMeasurementSet.coilActuationStatus = static_cast<uint8_t>(coilActStatus);
rawMtmMeasurementSet.setValidity(true, true);
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1

2
tmtc

@ -1 +1 @@
Subproject commit 00e99292cc158a347f485507537fa5b63262243b
Subproject commit 1b39bb2ad2421db89487b4ea352edbd4d420b9b1