Unlock STR secondary slot #864

Merged
meggert merged 11 commits from str-secondary-fw-slot-update into main 2024-02-28 09:21:30 +01:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit c434882e37 - Show all commits

View File

@ -7,6 +7,7 @@
#include <string>
#include "fsfw/filesystem/HasFileSystemIF.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/returnvalues/returnvalue.h"
#include "mission/memory/SdCardMountedIF.h"
@ -177,7 +178,7 @@ void StarTrackerHandler::loadTargetFirmwareFromPersistentCfg() {
const char* prefix = sdCardIF.getCurrentMountPrefix();
std::filesystem::path path = std::filesystem::path(prefix) / startracker::FW_TARGET_CFG_PATH;
meggert marked this conversation as resolved
Review

what if the file does not exist

what if the file does not exist
Review

it will just use the main slot. But a check is missing..

it will just use the main slot. But a check is missing..
std::ifstream ifile(path);
if (ifile.is_open()) {
if (ifile.is_open() and !ifile.bad()) {
std::string targetStr;
std::getline(ifile, targetStr);
if (targetStr == "backup") {
meggert marked this conversation as resolved Outdated

what if it is on BACKUP and we want to change it back to MAIN

what if it is on `BACKUP` and we want to change it back to `MAIN`

this is manipulated using parameters

this is manipulated using parameters
@ -2896,7 +2897,7 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) {
case startracker::REQ_CENTROID:
case startracker::REQ_CENTROIDS:
case startracker::REQ_CONTRAST: {
meggert marked this conversation as resolved Outdated

what is with FIRMWARE_BACKUP

what is with `FIRMWARE_BACKUP`
if (getMode() == MODE_ON and getSubmode() != startracker::Program::FIRMWARE_MAIN) {
if (getMode() == MODE_ON and getSubmode() != startracker::SUBMODE_FIRMWARE) {
return STARTRACKER_NOT_RUNNING_FIRMWARE;
}
break;
@ -2904,7 +2905,7 @@ ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) {
case startracker::FIRMWARE_UPDATE_MAIN:
case startracker::FIRMWARE_UPDATE_BACKUP:
case startracker::FLASH_READ:
if (getMode() != MODE_ON or getSubmode() != startracker::Program::BOOTLOADER) {
if (getMode() != MODE_ON or getSubmode() != startracker::SUBMODE_BOOTLOADER) {
return STARTRACKER_NOT_RUNNING_BOOTLOADER;
}
break;
@ -2940,8 +2941,7 @@ ReturnValue_t StarTrackerHandler::getParameter(uint8_t domainId, uint8_t uniqueI
of << "backup\n";
}
} else {
sif::warning << "SD card not usable" << std::endl;
return returnvalue::FAILED;
return HasFileSystemIF::FILESYSTEM_INACTIVE;
meggert marked this conversation as resolved Outdated

maybe a custom rtval here

maybe a custom rtval here
}
};
return returnvalue::OK;

View File

@ -253,7 +253,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun
auto psbParamsService5 =
PsbParams(objects::PUS_SERVICE_5_EVENT_REPORTING, config::EIVE_PUS_APID, pus::PUS_SERVICE_5);
psbParamsService5.requestQueueDepth = 50;
psbParamsService5.requestQueueDepth = 50;
psbParamsService5.maxPacketsPerCycle = 50;
new Service5EventReporting(psbParamsService5, 80, 160);
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, config::EIVE_PUS_APID,