add new command to reload the JSON file
All checks were successful
EIVE/eive-obsw/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2023-11-16 17:07:47 +01:00
parent 3be9cae8a5
commit 9010d1d202
4 changed files with 39 additions and 11 deletions

View File

@ -16,6 +16,18 @@ will consitute of a breaking change warranting a new major release:
# [unreleased]
## Fixed
- STR config path was previously hardcoded to `/mnt/sd0/startracker/flight-config.json`.
A new abstraction was introduces which now uses the active SD card to build the correct
config path when initializing the star tracker.
## Added
- Introduced a new `RELOAD_JSON_CFG_FILE` command for the STR to reload the JSON configuration
data based on the current output of the config file path getter function. A reboot of the
device is still necessary to load the configuration to the STR.
# [v7.3.0] 2023-11-07
## Changed
@ -696,7 +708,7 @@ This is the version which will fly on the satellite for the initial launch phase
This gives other tasks some time to register the SD cards being unusable, and therefore provides
a way for them to perform any re-initialization tasks necessary after SD card switches.
- TCS controller now only has an OFF mode and an ON mode
- The TCS controller pauses operations related to the TCS board assembly (reading sensors and
- The TCS controller pauses operations related to the TCS board assembly (reading sensors and
the primary control loop) while a TCS board recovery is on-going.
- Allow specifying custom OBSW update filename. This allowed keeping a cleaner file structure
where each update has a name including the version
@ -1761,8 +1773,8 @@ Syrlinks PR: PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/353
- Syrlinks Handler: Read RX frequency shift as 24 bit signed number now. Also include
validity handling for datasets.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/350
- `GyroADIS1650XHandler`: Changed calculation of angular rate to be sensitivity based instead of
max. range based, as previous fix still left an margin of error between ADIS16505 sensors
- `GyroADIS1650XHandler`: Changed calculation of angular rate to be sensitivity based instead of
max. range based, as previous fix still left an margin of error between ADIS16505 sensors
and L3GD20 sensors.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/346

View File

@ -139,14 +139,7 @@ ReturnValue_t StarTrackerHandler::initialize() {
// Spin up a thread to do the JSON initialization, takes 200-250 ms which would
// delay whole satellite boot process.
jcfgCountdown.resetTimer();
auto strCfgPath = cfgPathGetter.getCfgPath();
if (strCfgPath.has_value()) {
jsonCfgTask = std::thread{setUpJsonCfgs, std::ref(jcfgs), strCfgPath.value()};
} else {
// Simplified FDIR: Just continue as usual..
JCFG_DONE = true;
}
reloadJsonCfgFile();
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
@ -175,6 +168,18 @@ ReturnValue_t StarTrackerHandler::initialize() {
return returnvalue::OK;
}
bool StarTrackerHandler::reloadJsonCfgFile() {
jcfgCountdown.resetTimer();
auto strCfgPath = cfgPathGetter.getCfgPath();
if (strCfgPath.has_value()) {
jsonCfgTask = std::thread{setUpJsonCfgs, std::ref(jcfgs), strCfgPath.value()};
return true;
}
// Simplified FDIR: Just continue as usual..
JCFG_DONE = true;
return false;
}
ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) {
ReturnValue_t result = returnvalue::OK;
@ -193,6 +198,15 @@ ReturnValue_t StarTrackerHandler::executeAction(ActionId_t actionId, MessageQueu
addSecondaryTmForNormalMode(idToAdd);
return EXECUTION_FINISHED;
}
case (startracker::RELOAD_JSON_CFG_FILE): {
// It should be noted that this just reloads the JSON config structure in memory from the
// JSON file. The configuration still needs to be sent to the STR. The easiest way to achieve
// this is to simply reboot the device after a reload.
if (reloadJsonCfgFile()) {
return HasActionsIF::EXECUTION_FINISHED;
}
return returnvalue::FAILED;
}
case (startracker::RESET_SECONDARY_TM_SET): {
resetSecondaryTmSet();
return EXECUTION_FINISHED;

View File

@ -544,6 +544,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
void doNormalTransition(Mode_t modeFrom, Submode_t subModeFrom);
void bootFirmware(Mode_t toMode);
void bootBootloader();
bool reloadJsonCfgFile();
};
#endif /* MISSION_DEVICES_STARTRACKERHANDLER_H_ */

View File

@ -387,6 +387,7 @@ static constexpr DeviceCommandId_t REQ_CENTROIDS = 94;
static constexpr DeviceCommandId_t ADD_SECONDARY_TM_TO_NORMAL_MODE = 95;
static constexpr DeviceCommandId_t RESET_SECONDARY_TM_SET = 96;
static constexpr DeviceCommandId_t READ_SECONDARY_TM_SET = 97;
static constexpr DeviceCommandId_t RELOAD_JSON_CFG_FILE = 100;
static const DeviceCommandId_t NONE = 0xFFFFFFFF;
static const uint32_t VERSION_SET_ID = REQ_VERSION;