From b8e1c7afe91bddfea2b139217320033f3a3b0efb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 15 May 2023 15:20:56 +0200 Subject: [PATCH 1/7] new MPSoC events and retvals --- eive_tmtc/config/events.csv | 33 +++++++++++++++++-------------- eive_tmtc/config/returnvalues.csv | 7 ++++--- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/eive_tmtc/config/events.csv b/eive_tmtc/config/events.csv index 2d5f569..2df4aa3 100644 --- a/eive_tmtc/config/events.csv +++ b/eive_tmtc/config/events.csv @@ -177,20 +177,23 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12515;0x30e3;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;linux/acs/StrComHandler.h 12516;0x30e4;STR_HELPER_SENDING_PACKET_FAILED;LOW;No description;linux/acs/StrComHandler.h 12517;0x30e5;STR_HELPER_REQUESTING_MSG_FAILED;LOW;No description;linux/acs/StrComHandler.h -12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/payload/PlocMpsocHelper.h -12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;LOW;Flash write successful;linux/payload/PlocMpsocHelper.h -12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/payload/PlocMpsocHelper.h -12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/payload/PlocMpsocHelper.h -12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/payload/PlocMpsocHelper.h -12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/payload/PlocMpsocHelper.h -12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/payload/PlocMpsocHelper.h -12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux/payload/PlocMpsocHelper.h -12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/payload/PlocMpsocHelper.h -12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/payload/PlocMpsocHelper.h -12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/payload/PlocMpsocHelper.h -12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHelper.h -12612;0x3144;MPSOC_TM_SIZE_ERROR;LOW;No description;linux/payload/PlocMpsocHelper.h -12613;0x3145;MPSOC_TM_CRC_MISSMATCH;LOW;No description;linux/payload/PlocMpsocHelper.h +12600;0x3138;MPSOC_FLASH_WRITE_FAILED;LOW;Flash write fails;linux/payload/PlocMpsocSpecialComHelper.h +12601;0x3139;MPSOC_FLASH_WRITE_SUCCESSFUL;INFO;Flash write successful;linux/payload/PlocMpsocSpecialComHelper.h +12602;0x313a;MPSOC_SENDING_COMMAND_FAILED;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h +12603;0x313b;MPSOC_HELPER_REQUESTING_REPLY_FAILED;LOW;Request receive message of communication interface failed P1: Return value returned by the communication interface requestReceiveMessage function P2: Internal state of MPSoC helper;linux/payload/PlocMpsocSpecialComHelper.h +12604;0x313c;MPSOC_HELPER_READING_REPLY_FAILED;LOW;Reading receive message of communication interface failed P1: Return value returned by the communication interface readingReceivedMessage function P2: Internal state of MPSoC helper;linux/payload/PlocMpsocSpecialComHelper.h +12605;0x313d;MPSOC_MISSING_ACK;LOW;Did not receive acknowledgment report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/payload/PlocMpsocSpecialComHelper.h +12606;0x313e;MPSOC_MISSING_EXE;LOW;Did not receive execution report P1: Number of bytes missing P2: Internal state of MPSoC helper;linux/payload/PlocMpsocSpecialComHelper.h +12607;0x313f;MPSOC_ACK_FAILURE_REPORT;LOW;Received acknowledgment failure report P1: Internal state of MPSoC;linux/payload/PlocMpsocSpecialComHelper.h +12608;0x3140;MPSOC_EXE_FAILURE_REPORT;LOW;Received execution failure report P1: Internal state of MPSoC;linux/payload/PlocMpsocSpecialComHelper.h +12609;0x3141;MPSOC_ACK_INVALID_APID;LOW;Expected acknowledgment report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/payload/PlocMpsocSpecialComHelper.h +12610;0x3142;MPSOC_EXE_INVALID_APID;LOW;Expected execution report but received space packet with other apid P1: Apid of received space packet P2: Internal state of MPSoC;linux/payload/PlocMpsocSpecialComHelper.h +12611;0x3143;MPSOC_HELPER_SEQ_CNT_MISMATCH;LOW;Received sequence count does not match expected sequence count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocSpecialComHelper.h +12612;0x3144;MPSOC_TM_SIZE_ERROR;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h +12613;0x3145;MPSOC_TM_CRC_MISSMATCH;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h +12614;0x3146;MPSOC_FLASH_READ_PACKET_ERROR;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h +12615;0x3147;MPSOC_FLASH_READ_FAILED;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h +12616;0x3148;MPSOC_FLASH_READ_SUCCESSFUL;INFO;No description;linux/payload/PlocMpsocSpecialComHelper.h 12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/payload/PayloadPcduHandler.h 12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/payload/PayloadPcduHandler.h 12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/payload/PayloadPcduHandler.h @@ -274,7 +277,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 14105;0x3719;CAMERA_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14106;0x371a;PCDU_SYSTEM_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14107;0x371b;HEATER_NOT_OFF_FOR_OFF_MODE;MEDIUM;No description;mission/controller/tcsDefs.h -14108;0x371c;MGT_OVERHEATING;MEDIUM;No description;mission/controller/tcsDefs.h +14108;0x371c;MGT_OVERHEATING;HIGH;No description;mission/controller/tcsDefs.h 14201;0x3779;TX_TIMER_EXPIRED;INFO;The transmit timer to protect the Syrlinks expired P1: The current timer value;mission/system/com/ComSubsystem.h 14202;0x377a;BIT_LOCK_TX_ON;INFO;Transmitter will be turned on due to detection of bitlock;mission/system/com/ComSubsystem.h 14300;0x37dc;POSSIBLE_FILE_CORRUPTION;LOW;P1: Result code of TM packet parser. P2: Timestamp of possibly corrupt file as a unix timestamp.;mission/persistentTmStoreDefs.h diff --git a/eive_tmtc/config/returnvalues.csv b/eive_tmtc/config/returnvalues.csv index 20b76df..1bc9186 100644 --- a/eive_tmtc/config/returnvalues.csv +++ b/eive_tmtc/config/returnvalues.csv @@ -478,8 +478,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x53b6;STRH_StartrackerAlreadyBooted;Star tracker is already in firmware mode;182;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x53b7;STRH_StartrackerNotRunningFirmware;Star tracker must be in firmware mode to run this command;183;STR_HANDLER;mission/acs/str/StarTrackerHandler.h 0x53b8;STRH_StartrackerNotRunningBootloader;Star tracker must be in bootloader mode to run this command;184;STR_HANDLER;mission/acs/str/StarTrackerHandler.h -0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpscoDefs.h -0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpscoDefs.h +0x54e0;DWLPWRON_InvalidMode;Received command has invalid JESD mode (valid modes are 0 - 5);224;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h +0x54e1;DWLPWRON_InvalidLaneRate;Received command has invalid lane rate (valid lane rate are 0 - 9);225;DWLPWRON_CMD;linux/payload/plocMpsocHelpers.h 0x5700;PLSPVhLP_RequestDone;No description;0;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x5701;PLSPVhLP_NoPacketFound;No description;1;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h 0x5702;PLSPVhLP_DecodeBufTooSmall;No description;2;PLOC_SUPV_HELPER;linux/payload/PlocSupvUartMan.h @@ -543,7 +543,8 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path 0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NvmParameterBase.h 0x64a0;FSHLP_SdNotMounted;SD card specified with path string not mounted;160;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h 0x64a1;FSHLP_FileNotExists;Specified file does not exist on filesystem;161;FILE_SYSTEM_HELPER;bsp_q7s/fs/FilesystemHelper.h -0x65a0;PLMPHLP_FileClosedAccidentally;File accidentally close;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocHelper.h +0x65a0;PLMPHLP_FileWriteError;File error occured for file transfers from OBC to the MPSoC.;160;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h +0x65a1;PLMPHLP_FileReadError;File error occured for file transfers from MPSoC to OBC.;161;PLOC_MPSOC_HELPER;linux/payload/PlocMpsocSpecialComHelper.h 0x66a0;SADPL_CommandNotSupported;No description;160;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x66a1;SADPL_DeploymentAlreadyExecuting;No description;161;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h 0x66a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h -- 2.43.0 From 6ec0ce20fa98877c9f88acb5fe9129254291344b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 17 May 2023 17:15:43 +0200 Subject: [PATCH 2/7] new event --- eive_tmtc/config/events.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/eive_tmtc/config/events.csv b/eive_tmtc/config/events.csv index 2df4aa3..9dc26e0 100644 --- a/eive_tmtc/config/events.csv +++ b/eive_tmtc/config/events.csv @@ -194,6 +194,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path 12614;0x3146;MPSOC_FLASH_READ_PACKET_ERROR;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h 12615;0x3147;MPSOC_FLASH_READ_FAILED;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h 12616;0x3148;MPSOC_FLASH_READ_SUCCESSFUL;INFO;No description;linux/payload/PlocMpsocSpecialComHelper.h +12617;0x3149;MPSOC_READ_TIMEOUT;LOW;No description;linux/payload/PlocMpsocSpecialComHelper.h 12700;0x319c;TRANSITION_BACK_TO_OFF;MEDIUM;Could not transition properly and went back to ALL OFF;mission/payload/PayloadPcduHandler.h 12701;0x319d;NEG_V_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/payload/PayloadPcduHandler.h 12702;0x319e;U_DRO_OUT_OF_BOUNDS;MEDIUM;P1: 0 -> too low, 1 -> too high P2: Float value;mission/payload/PayloadPcduHandler.h -- 2.43.0 From ef1da1e882c7ce5debdb929e1653c50cf96b8c64 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 17 May 2023 19:00:17 +0200 Subject: [PATCH 3/7] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a57d1d4..782fca2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ list yields a list of all related PRs for each release. # [unreleased] +# [v3.2.0] to be released + ## Added - Event handling for reboot counter events. -- 2.43.0 From 49dde29847b0cde4b51fe4af6425c5cc0f6fcc27 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 19 May 2023 11:01:06 +0200 Subject: [PATCH 4/7] generic systemctl --- eive_tmtc/tmtc/core.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/eive_tmtc/tmtc/core.py b/eive_tmtc/tmtc/core.py index 461cc1f..fb138e9 100644 --- a/eive_tmtc/tmtc/core.py +++ b/eive_tmtc/tmtc/core.py @@ -251,15 +251,7 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str): int(input("Specify systemctl command type by key: ")) ) unit_name = input("Specify unit name: ") - cmd_data = bytearray([systemctl_cmd]) - cmd_data.extend(unit_name.encode()) - q.add_pus_tc( - create_action_cmd( - object_id=CORE_CONTROLLER_ID, - action_id=ActionId.SYSTEMCTL_CMD_EXECUTOR, - user_data=cmd_data, - ) - ) + q.add_pus_tc(create_systemctl_cmd(systemctl_cmd, unit_name)) elif op_code == OpCode.EXECUTE_SHELL_CMD_BLOCKING: custom_cmd = input("Please specify command to execute: ") q.add_pus_tc( @@ -458,6 +450,16 @@ def pack_core_commands(q: DefaultPusQueueHelper, op_code: str): ) +def create_systemctl_cmd(systemctl_cmd: SystemctlCmd, unit_name: str): + cmd_data = bytearray([systemctl_cmd]) + cmd_data.extend(unit_name.encode()) + return create_action_cmd( + object_id=CORE_CONTROLLER_ID, + action_id=ActionId.SYSTEMCTL_CMD_EXECUTOR, + user_data=cmd_data, + ) + + def list_directory_base_user_data() -> bytearray: all_opt = int(input("Use all (-a) option (0/1) ?: ")) if all_opt not in [0, 1]: -- 2.43.0 From de02d81e1dc6897002c276277f07e6d181ac7719 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 7 Jun 2023 16:56:43 +0200 Subject: [PATCH 5/7] better exception handling --- eive_tmtc/pus_tm/factory_hook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/pus_tm/factory_hook.py b/eive_tmtc/pus_tm/factory_hook.py index 2c307bf..8e8108a 100644 --- a/eive_tmtc/pus_tm/factory_hook.py +++ b/eive_tmtc/pus_tm/factory_hook.py @@ -35,7 +35,8 @@ def pus_factory_hook( return try: tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty()) - except ValueError: + except ValueError as value_error: + _LOGGER.warning(f"{value_error}") _LOGGER.warning("Could not generate PUS TM object from raw data") _LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}") return -- 2.43.0 From 17dd9de51e174828ecb244fc5508de3d5f867ac2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 7 Jun 2023 17:25:51 +0200 Subject: [PATCH 6/7] moved 2 parameters --- eive_tmtc/tmtc/power/tm.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/eive_tmtc/tmtc/power/tm.py b/eive_tmtc/tmtc/power/tm.py index 4ae2ef9..44ce657 100644 --- a/eive_tmtc/tmtc/power/tm.py +++ b/eive_tmtc/tmtc/power/tm.py @@ -153,11 +153,9 @@ def handle_pdu_data( current_idx = 0 priv_idx = pdu_idx - 1 if set_id == SetId.AUX or set_id == SetId.AUX: - fmt_str = "!hhBBBIIH" + fmt_str = "!BBBIIH" inc_len = struct.calcsize(fmt_str) ( - vcc, - vbat, conv_enb_0, conv_enb_1, conv_enb_2, @@ -165,7 +163,6 @@ def handle_pdu_data( uptime, reset_cause, ) = struct.unpack(fmt_str, hk_data[current_idx : current_idx + inc_len]) - pw.dlog(f"VCC {vcc} mV | VBAT {vbat} mV") pw.dlog(f"Converter Enables [{conv_enb_0},{conv_enb_1},{conv_enb_2}]") pw.dlog( f"Boot Cause {boot_cause} | Uptime {uptime} | Reset Cause {reset_cause}", @@ -216,14 +213,14 @@ def handle_pdu_data( f"{voltage_list[idx]:05} | {current_list[idx]:04}" ) pw.dlog(content_line) - fmt_str = "!IBf" + fmt_str = "!IBfhh" inc_len = struct.calcsize(fmt_str) - (boot_count, batt_mode, temperature) = struct.unpack( + (boot_count, batt_mode, temperature, vcc, vbat) = struct.unpack( fmt_str, hk_data[current_idx : current_idx + inc_len] ) info = ( f"Boot Count {boot_count} | Battery Mode {batt_mode} | " - f"Temperature {temperature}" + f"Temperature {temperature} | VCC {vcc} | VBAT {vbat}" ) pw.dlog(info) -- 2.43.0 From a5a30d37ebefb897d9b60de11a14903cccd84f93 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 9 Jun 2023 12:41:49 +0200 Subject: [PATCH 7/7] tweak changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cdff101..da5dd7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ list yields a list of all related PRs for each release. # [v4.0.0] to be released -`tmtccmd` version: v5.0.0rc0 +`tmtccmd` version: v5.0.0a0 ## Added @@ -23,7 +23,7 @@ list yields a list of all related PRs for each release. ## Fixed - Fix for PLOC power switching. -- Bump `tmtccmd` to v5.0.0rc0 for important bugfix in CFDP header. +- Bump `tmtccmd` to v5.0.0a0 for important bugfix in CFDP header. # [v3.1.1] 2023-04-17 -- 2.43.0