From 390081d00e17fb0940b34ea77a0e560c887f7d7d Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sun, 25 Jul 2021 17:56:36 +0200
Subject: [PATCH 01/21] ploc supervisor get boot status report added, not
tested
---
.idea/runConfigurations/PLOC_SUPV_Test.xml | 4 ++--
config/hook_implementations.py | 1 +
pus_tc/ploc_supervisor.py | 9 ++++++++-
tmtccmd | 2 +-
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/PLOC_SUPV_Test.xml
index 843dd32..56515a7 100644
--- a/.idea/runConfigurations/PLOC_SUPV_Test.xml
+++ b/.idea/runConfigurations/PLOC_SUPV_Test.xml
@@ -6,9 +6,9 @@
-
+
-
+
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 83c34e6..b1d2b6e 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -95,6 +95,7 @@ class EiveHookObject(TmTcHookBase):
"10": ("PLOC Supervisor: Set time reference", {OpCodeDictKeys.TIMEOUT: 2.0}),
"11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "13": ("PLOC Supervisor: Request boot status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index 7d80905..9feb841 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -25,10 +25,12 @@ class SupvActionIds:
RESET_MPSOC = 8
SET_TIME_REF = 9
DISABLE_HK = 10
+ GET_BOOT_STATUS_REPORT = 11
class SupvHkIds:
HK_REPORT = 52
+ BOOT_STATUS_REPORT = 53
def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@@ -91,7 +93,12 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
elif op_code == "12":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable HK"))
command = object_id + struct.pack('!I', SupvActionIds.DISABLE_HK)
- command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ command = PusTelecommand(service=8, subservice=128, ssc=29, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "13":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Request boot status report"))
+ command = object_id + struct.pack('!I', SupvActionIds.GET_BOOT_STATUS_REPORT)
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
diff --git a/tmtccmd b/tmtccmd
index 657b7b3..978db08 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 657b7b3f36f931eabf6ee4ff8267a119702099c8
+Subproject commit 978db08986105345bb378157623688c6d1531b1e
--
2.34.1
From 75ae2c786b2422ea1986ce69bdcd528346e88f1a Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Mon, 26 Jul 2021 16:29:54 +0200
Subject: [PATCH 02/21] update availabe and watchdogs enable command
---
config/hook_implementations.py | 2 ++
pus_tc/ploc_supervisor.py | 49 ++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index c5869d9..aaeddd0 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -96,6 +96,8 @@ class EiveHookObject(TmTcHookBase):
"11": ("PLOC Supervisor: Set boot timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
"12": ("PLOC Supervisor: Disable Hk", {OpCodeDictKeys.TIMEOUT: 2.0}),
"13": ("PLOC Supervisor: Request boot status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index f2ce4e0..34fbbef 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -26,6 +26,8 @@ class SupvActionIds:
SET_TIME_REF = 9
DISABLE_HK = 10
GET_BOOT_STATUS_REPORT = 11
+ UPDATE_AVAILABLE = 12
+ WATCHDOGS_ENABLE = 13
class SupvHkIds:
@@ -100,6 +102,16 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = object_id + struct.pack('!I', SupvActionIds.GET_BOOT_STATUS_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "14":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update available"))
+ command = pack_update_available_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "15":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Watchdogs Enable"))
+ command = pack_watchdogs_enable_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@@ -119,3 +131,40 @@ def pack_sel_boot_image_cmd(object_id: bytearray, mem: int, bp0: int, bp1: int,
command = command + struct.pack('!B', bp1)
command = command + struct.pack('!B', bp2)
return command
+
+
+def pack_update_available_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the udpate availabe command.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ image_select = 1
+ image_partition = 0
+ image_size = 222
+ image_crc = 0x0
+ number_of_packets = 150
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.UPDATE_AVAILABLE)
+ command = command + struct.pack('!B', image_select)
+ command = command + struct.pack('!B', image_partition)
+ command = command + struct.pack('!I', image_size)
+ command = command + struct.pack('!I', image_crc)
+ command = command + struct.pack('!I', number_of_packets)
+ return command
+
+
+def pack_watchdogs_enable_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to enable or disable watchdogs on the PLOC.
+ @param object_id The object id of the PLOC supervisor handler.
+ @note Enable = 1, Disable = 0
+ """
+ watchdog_ps = 1
+ watchdog_pl = 1
+ watchdog_int = 0
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.WATCHDOGS_ENABLE)
+ command = command + struct.pack('!B', watchdog_ps)
+ command = command + struct.pack('!B', watchdog_pl)
+ command = command + struct.pack('!B', watchdog_int)
+ return command
--
2.34.1
From 0b6bfdd23a811e4526ca394fee74d540503bcff4 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Tue, 27 Jul 2021 11:48:42 +0200
Subject: [PATCH 03/21] tmtccmd update
---
tmtccmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmtccmd b/tmtccmd
index 1e23485..8bdcbc5 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 1e234851ecc08bee1765804e347efe5785b4486e
+Subproject commit 8bdcbc5b87cd1062c5dd6c7d3bd4d7c3bfc8eb42
--
2.34.1
From f2e95444c7f2dc165ad1aa6e11a89548c5fe715d Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Tue, 27 Jul 2021 11:50:29 +0200
Subject: [PATCH 04/21] tmtccmd update
---
tmtccmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmtccmd b/tmtccmd
index 8bdcbc5..f8403c3 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 8bdcbc5b87cd1062c5dd6c7d3bd4d7c3bfc8eb42
+Subproject commit f8403c3934b085b80643911e21dc072c238361d3
--
2.34.1
From 7ffda5f9ee59abbbd56bf37530980bf663b74b3d Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Tue, 27 Jul 2021 11:54:35 +0200
Subject: [PATCH 05/21] tmtccmd update
---
tmtccmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmtccmd b/tmtccmd
index f8403c3..91e4053 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit f8403c3934b085b80643911e21dc072c238361d3
+Subproject commit 91e405367694952a711c4849a38df0f23334b963
--
2.34.1
From 31bc3d86895dfabf59002880376e9ebfd9015923 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Wed, 28 Jul 2021 15:24:39 +0200
Subject: [PATCH 06/21] tmtccmd update
---
tmtccmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmtccmd b/tmtccmd
index 91e4053..2058b28 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 91e405367694952a711c4849a38df0f23334b963
+Subproject commit 2058b28fa167fa1cc3eb7dd69b18b4968e86ddb1
--
2.34.1
From 55ca9105495e7476a0e1673835398a0bd39c8c1f Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Wed, 28 Jul 2021 19:35:46 +0200
Subject: [PATCH 07/21] few more ploc supervisor commands
---
config/hook_implementations.py | 16 ++
pus_tc/ploc_supervisor.py | 283 +++++++++++++++++++++++++++++++++
2 files changed, 299 insertions(+)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index aaeddd0..3605fbf 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -98,6 +98,22 @@ class EiveHookObject(TmTcHookBase):
"13": ("PLOC Supervisor: Request boot status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
"14": ("PLOC Supervisor: Update available", {OpCodeDictKeys.TIMEOUT: 2.0}),
"15": ("PLOC Supervisor: Watchdogs enable", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "16": ("PLOC Supervisor: Watchdog Configure Timeout", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "17": ("PLOC Supervisor: Enable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "18": ("PLOC Supervisor: Disable latchup alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "19": ("PLOC Supervisor: Auto calibrate alert", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "20": ("PLOC Supervisor: Set alert limit", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "21": ("PLOC Supervisor: Set alert irq filter", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "22": ("PLOC Supervisor: Set ADC sweep period", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "23": ("PLOC Supervisor: Set ADC enabled channels", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "24": ("PLOC Supervisor: Set ADC window and stride", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "25": ("PLOC Supervisor: Set ADC threshold", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "26": ("PLOC Supervisor: Request latchup status report", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "27": ("PLOC Supervisor: Copy ADC data to MRAM", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "28": ("PLOC Supervisor: Enable/Disable NVM0/1/3", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index 34fbbef..f281a25 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -13,6 +13,15 @@ from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
+latchup_id_dict = {
+ "0": "0.85V",
+ "1": "1.8V",
+ "2": "MISC",
+ "3": "3.3V",
+ "4": "NVM_4XO",
+ "5": "MISSION",
+ "6": "SAFECOTS"
+ }
class SupvActionIds:
HK_REPORT = 1
@@ -28,6 +37,32 @@ class SupvActionIds:
GET_BOOT_STATUS_REPORT = 11
UPDATE_AVAILABLE = 12
WATCHDOGS_ENABLE = 13
+ WATCHDOGS_CONFIG_TIMEOUT = 14
+ ENABLE_LATCHUP_ALERT = 15
+ DISABLE_LATCHUP_ALERT = 16
+ AUTO_CALIBRATE_ALERT = 17
+ SET_ALERT_LIMIT = 18
+ SET_ALERT_IRQ_FILTER = 19
+ SET_ADC_SWEEP_PERIOD = 20
+ SET_ADC_ENABLED_CHANNELS = 21
+ SET_ADC_WINDOW_AND_STRIDE = 22
+ SET_ADC_THRESHOLD = 23
+ GET_LATCHUP_STATUS_REPORT = 24
+ COPY_ADC_DATA_TO_MRAM = 25
+ ENABLE_NVMS = 26
+ SELECT_NVM = 27
+ RUN_AUTO_EM_TESTS = 28
+ WIPE_MRAM = 29
+ DUMP_MRAM = 30
+ SET_DBG_VERBOSITY = 31
+ CAN_LOOPBACK_TEST = 32
+ PRINT_CPU_STATS = 33
+ SET_GPIO = 34
+ READ_GPIO = 35
+ RESTART_SUPERVISOR = 36
+ FACTORY_RESET = 37
+ REQUEST_LOGGING_DATA = 38
+ UPDATE_IMAGE_DATA = 39
class SupvHkIds:
@@ -112,6 +147,86 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = pack_watchdogs_enable_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "16":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Watchdog configure timeout"))
+ command = pack_watchdog_config_timeout_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "17":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable latchup alert"))
+ command = pack_lachtup_alert_cmd(object_id, True)
+ command = PusTelecommand(service=8, subservice=128, ssc=34, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "18":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Disable latchup alert"))
+ command = pack_lachtup_alert_cmd(object_id, False)
+ command = PusTelecommand(service=8, subservice=128, ssc=35, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "19":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Auto calibrate alert"))
+ command = pack_auto_calibrate_alert_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=36, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "20":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set alert limit"))
+ command = pack_set_alert_limit_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=37, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "21":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set alert irq filter"))
+ command = pack_set_alert_irq_filter_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=38, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "22":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC sweep period"))
+ command = pack_set_adc_sweep_period_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=39, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "23":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC enabled channels"))
+ command = pack_set_adc_enabled_channels_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "24":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC window and stride"))
+ command = pack_set_adc_window_and_stride_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=41, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "25":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set ADC threshold"))
+ command = pack_set_adc_threshold_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=42, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "26":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Request latchup status report"))
+ command = object_id + struct.pack('!I', SupvActionIds.GET_LATCHUP_STATUS_REPORT)
+ command = PusTelecommand(service=8, subservice=128, ssc=43, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "27":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Copy ADC data to MRAM"))
+ command = object_id + struct.pack('!I', SupvActionIds.COPY_ADC_DATA_TO_MRAM)
+ command = PusTelecommand(service=8, subservice=128, ssc=44, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "28":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enalbe/Disable NVMs"))
+ command = pack_enable_nvms_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "29":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Select NVM"))
+ command = pack_select_nvm_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "30":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Run auto EM tests"))
+ command = pack_auto_em_tests_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=45, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "31":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Wipe MRAM"))
+ command = pack_mram_wipe_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@@ -168,3 +283,171 @@ def pack_watchdogs_enable_cmd(object_id: bytearray) -> bytearray:
command = command + struct.pack('!B', watchdog_pl)
command = command + struct.pack('!B', watchdog_int)
return command
+
+
+def pack_watchdog_config_timeout_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command set the timeout of one of the three watchdogs of the PLOC.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ watchdog = int(input("Specify watchdog (0 - PS, 1 - PL, 2 - INT):"))
+ timeout = int(input("Specify timeout (1000 ms - 360000 ms):"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.WATCHDOGS_CONFIG_TIMEOUT)
+ command = command + struct.pack('!B', watchdog)
+ command = command + struct.pack('!I', timeout)
+ return command
+
+
+def pack_lachtup_alert_cmd(object_id: bytearray, state: bool) -> bytearray:
+ """
+ @brief This function packs the command to enable or disable a certain latchup alerts.
+ @param object_id The object id of the PLOC supervisor handler.
+ @param state True - enable latchup alert, False - disable latchup alert
+ """
+ latchup_id = get_latchup_id()
+ command = bytearray()
+ if state:
+ command = object_id + struct.pack('!I', SupvActionIds.ENABLE_LATCHUP_ALERT)
+ else:
+ command = object_id + struct.pack('!I', SupvActionIds.DISABLE_LATCHUP_ALERT)
+ command = command + struct.pack('!B', latchup_id)
+ return command
+
+
+def pack_auto_calibrate_alert_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to auto calibrate a latchup alert.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ latchup_id = get_latchup_id()
+ mg = int(input("Specify MG:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.AUTO_CALIBRATE_ALERT)
+ command = command + struct.pack('!B', latchup_id)
+ command = command + struct.pack('!I', mg)
+ return command
+
+
+def get_latchup_id() -> int:
+ key_column_width = 10
+ description_column_width = 50
+ separator_width = key_column_width + description_column_width + 3
+ separator_string = separator_width * "-"
+ key_string = "Latchup ID".ljust(key_column_width)
+ description_string = "Description".ljust(description_column_width)
+ print(f"{key_string} | {description_string}")
+ print(separator_string)
+ for key in latchup_id_dict:
+ key_string = key.ljust(key_column_width)
+ description_string = latchup_id_dict[key].ljust(description_column_width)
+ print(f"{key_string} | {description_string}")
+ return int(input("Specify latchup ID:"))
+
+
+def pack_set_alert_limit_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to set the limit of a latchup alert.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ latchup_id = get_latchup_id()
+ dutycycle = int(input("Specify dutycycle:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.AUTO_CALIBRATE_ALERT)
+ command = command + struct.pack('!B', latchup_id)
+ command = command + struct.pack('!I', dutycycle)
+ return command
+
+
+def pack_set_alert_irq_filter_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to configure the latchup alert irq filter.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ latchup_id = get_latchup_id()
+ tp = int(input("Specify TP:"))
+ div = int(input("Specify DIV:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_ALERT_IRQ_FILTER)
+ command = command + struct.pack('!B', latchup_id)
+ command = command + struct.pack('!B', tp)
+ command = command + struct.pack('!B', div)
+ return command
+
+
+def pack_set_adc_sweep_period_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to set the limit of a latchup alert.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ sweep_period = int(input("Specify sweep period (min 21 us):"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_SWEEP_PERIOD)
+ command = command + struct.pack('!I', sweep_period)
+ return command
+
+
+def pack_set_adc_enabled_channels_cmd(object_id: bytearray) -> bytearray:
+ """
+ @brief This function packs the command to enable or disable channels of the ADC.
+ @param object_id The object id of the PLOC supervisor handler.
+ """
+ ch = int(input("Specify ch:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_ENABLED_CHANNELS)
+ command = command + struct.pack('!H', ch)
+ return command
+
+
+def pack_set_adc_window_and_stride_cmd(object_id: bytearray) -> bytearray:
+ window_size = int(input("Specify window size:"))
+ striding_step_size = int(input("Specify striding step size:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_WINDOW_AND_STRIDE)
+ command = command + struct.pack('!H', window_size)
+ command = command + struct.pack('!H', striding_step_size)
+ return command
+
+
+def pack_set_adc_threshold_cmd(object_id: bytearray) -> bytearray:
+ threshold = int(input("Specify threshold:"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_ADC_THRESHOLD)
+ command = command + struct.pack('!I', threshold)
+ return command
+
+
+def pack_enable_nvms_cmd(object_id: bytearray) -> bytearray:
+ n01 = int(input("NVM0/1 (0 - off, 1 - on):"))
+ n3 = int(input("NVM3 (0 - off, 1 - on):"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.ENABLE_NVMS)
+ command = command + struct.pack('!B', n01)
+ command = command + struct.pack('!B', n3)
+ return command
+
+
+def pack_select_nvm_cmd(object_id: bytearray) -> bytearray:
+ mem = int(input("Specify NVM (0 - NVM0, 1 - MVM1):"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SELECT_NVM)
+ command = command + struct.pack('!B', mem)
+ return command
+
+
+def pack_auto_em_tests_cmd(object_id: bytearray) -> bytearray:
+ test = int(input("Specify test (1 - complete, 2 - short):"))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.RUN_AUTO_EM_TESTS)
+ command = command + struct.pack('!B', test)
+ return command
+
+
+def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
+ start = int(input("Start address: 0x"), 16)
+ stop = int(input("Stop address: 0x"), 16)
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.WIPE_MRAM)
+ command = command + struct.pack('!I', start)
+ command = command + struct.pack('!I', stop)
+ return command
\ No newline at end of file
--
2.34.1
From 1b1f26ac3a948a320a29a16083613ea29789a378 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Thu, 29 Jul 2021 08:58:12 +0200
Subject: [PATCH 08/21] mram dump and mram wipe tc, fix in hook_implementations
---
config/hook_implementations.py | 3 ++-
pus_tc/ploc_supervisor.py | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index e83846f..893d805 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -114,6 +114,7 @@ class EiveHookObject(TmTcHookBase):
"29": ("PLOC Supervisor: Select NVM", {OpCodeDictKeys.TIMEOUT: 2.0}),
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "32": ("PLOC Supervisor: MRAM Dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
@@ -157,7 +158,7 @@ class EiveHookObject(TmTcHookBase):
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer,
- json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0865
+ json_cfg_path=self.get_json_config_file_path()
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index f281a25..70592d6 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -227,6 +227,11 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = pack_mram_wipe_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=46, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "32":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Dump MRAM"))
+ command = pack_mram_dump_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@@ -450,4 +455,13 @@ def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
command = object_id + struct.pack('!I', SupvActionIds.WIPE_MRAM)
command = command + struct.pack('!I', start)
command = command + struct.pack('!I', stop)
+ return command
+
+def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
+ start = int(input("Start address: 0x"), 16)
+ stop = int(input("Stop address: 0x"), 16)
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.DUMP_MRAM)
+ command = command + struct.pack('!I', start)
+ command = command + struct.pack('!I', stop)
return command
\ No newline at end of file
--
2.34.1
From 6fcd52daa693040099cac85367863ad24e477f9a Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sat, 31 Jul 2021 08:32:14 +0200
Subject: [PATCH 09/21] added processing of mram dump tm in service 8 hook
---
pus_tm/service_8_hook.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/pus_tm/service_8_hook.py b/pus_tm/service_8_hook.py
index 4d50c4a..358be86 100644
--- a/pus_tm/service_8_hook.py
+++ b/pus_tm/service_8_hook.py
@@ -3,6 +3,7 @@ from typing import Tuple
from config.object_ids import *
from pus_tc.imtq import ImtqActionIds
from pus_tc.ploc_mpsoc import PlocReplyIds
+from pus_tc.ploc_supervisor import SupvActionIds
def user_analyze_service_8_data(
@@ -32,6 +33,8 @@ def user_analyze_service_8_data(
return handle_imtq_replies(action_id, custom_data)
elif object_id == PLOC_MPSOC_ID:
return handle_ploc_replies(action_id, custom_data)
+ elif object_id == PLOC_SUPV_ID:
+ return handle_supervisor_replies(action_id, custom_data)
else:
header_list = []
content_list = []
@@ -56,3 +59,12 @@ def handle_ploc_replies(action_id: int, custom_data: bytearray) -> Tuple[list, l
header_list = ['PLOC Memory Address', 'PLOC Mem Len', 'PLOC Read Memory Data']
content_list = [custom_data[:4], custom_data[4:6], custom_data[6:10]]
return header_list, content_list
+
+
+def handle_supervisor_replies(action_id: int, custom_data: bytearray) -> Tuple[list, list]:
+ header_list = []
+ content_list = []
+ if action_id == SupvActionIds.DUMP_MRAM:
+ header_list = ['MRAM Dump']
+ content_list = [custom_data[:len(custom_data)]]
+ return header_list, content_list
--
2.34.1
From 9a7d5f08d07177c880d0ad20467fe6080df75d9e Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sun, 1 Aug 2021 17:12:09 +0200
Subject: [PATCH 10/21] supervisor run configuration
---
.idea/runConfigurations/PLOC_SUPV_Test.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/PLOC_SUPV_Test.xml
index 56515a7..843dd32 100644
--- a/.idea/runConfigurations/PLOC_SUPV_Test.xml
+++ b/.idea/runConfigurations/PLOC_SUPV_Test.xml
@@ -6,9 +6,9 @@
-
+
-
+
--
2.34.1
From 93fdc0fc7f44ad0d301b8616cd3526a9d16da8be Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Mon, 2 Aug 2021 11:27:34 +0200
Subject: [PATCH 11/21] some more supervisor TCs
---
config/hook_implementations.py | 4 +++-
pus_tc/ploc_supervisor.py | 37 ++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 893d805..23644b4 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -115,6 +115,8 @@ class EiveHookObject(TmTcHookBase):
"30": ("PLOC Supervisor: Run auto EM tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
"31": ("PLOC Supervisor: MRAM Wipe", {OpCodeDictKeys.TIMEOUT: 2.0}),
"32": ("PLOC Supervisor: MRAM Dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
@@ -158,7 +160,7 @@ class EiveHookObject(TmTcHookBase):
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer,
- json_cfg_path=self.get_json_config_file_path()
+ json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0065
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index 70592d6..65aec36 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -232,6 +232,16 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = pack_mram_dump_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=47, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "33":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Print CPU stats"))
+ command = pack_print_cpu_stats_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=48, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "34":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set debug verbosity"))
+ command = pack_set_debug_verbosity_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@@ -457,6 +467,7 @@ def pack_mram_wipe_cmd(object_id: bytearray) -> bytearray:
command = command + struct.pack('!I', stop)
return command
+
def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
start = int(input("Start address: 0x"), 16)
stop = int(input("Stop address: 0x"), 16)
@@ -464,4 +475,30 @@ def pack_mram_dump_cmd(object_id: bytearray) -> bytearray:
command = object_id + struct.pack('!I', SupvActionIds.DUMP_MRAM)
command = command + struct.pack('!I', start)
command = command + struct.pack('!I', stop)
+ return command
+
+
+def pack_print_cpu_stats_cmd(object_id: bytearray) -> bytearray:
+ en = 1
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.PRINT_CPU_STATS)
+ command = command + struct.pack('!B', en)
+ return command
+
+
+def pack_set_debug_verbosity_cmd(object_id: bytearray) -> bytearray:
+ command = bytearray()
+ print("Specify debug verbosity")
+ verbosity_options_dict = {
+ 0: "None",
+ 1: "Error",
+ 2: "Warn",
+ 3: "Info",
+ }
+ print("{:<6} | {}".format('Key', 'Description'))
+ for entry in verbosity_options_dict.items():
+ print("{:<6} | {}".format(entry[0], entry[1]))
+ verbosity = int(input("Specify verbosity key: "))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_DBG_VERBOSITY)
+ command = command + struct.pack('!B', verbosity)
return command
\ No newline at end of file
--
2.34.1
From d782aa271534490f07fba0b3dbb3faa5c29a02b3 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Mon, 2 Aug 2021 11:30:20 +0200
Subject: [PATCH 12/21] space packet id typo
---
config/hook_implementations.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 23644b4..c5bad08 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -160,7 +160,7 @@ class EiveHookObject(TmTcHookBase):
from tmtccmd.config.com_if import create_communication_interface_default
return create_communication_interface_default(
com_if_key=com_if_key, tmtc_printer=tmtc_printer,
- json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0065
+ json_cfg_path=self.get_json_config_file_path(), space_packet_id=0x0865
)
def perform_mode_operation(self, tmtc_backend: TmTcHandler, mode: int):
--
2.34.1
From 4aebf4c0d9a4a094e1a18753bca77d6a3b993378 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Mon, 2 Aug 2021 15:28:34 +0200
Subject: [PATCH 13/21] debug tcs added
---
config/hook_implementations.py | 6 ++
pus_tc/ploc_supervisor.py | 100 ++++++++++++++++++++++++++++-----
2 files changed, 93 insertions(+), 13 deletions(-)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index c5bad08..57005f4 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -117,6 +117,12 @@ class EiveHookObject(TmTcHookBase):
"32": ("PLOC Supervisor: MRAM Dump", {OpCodeDictKeys.TIMEOUT: 2.0}),
"33": ("PLOC Supervisor: Print CPU stats", {OpCodeDictKeys.TIMEOUT: 2.0}),
"34": ("PLOC Supervisor: Set debug verbosity", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "35": ("PLOC Supervisor: Set GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "36": ("PLOC Supervisor: Read GPIO", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "37": ("PLOC Supervisor: Restart supervisor", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "38": ("PLOC Supervisor: Factory reset clear all", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "39": ("PLOC Supervisor: Factory reset clear mirror entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "40": ("PLOC Supervisor: Factory reset clear circular entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index 65aec36..b9a11b4 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -12,6 +12,9 @@ from tmtccmd.config.definitions import QueueCommands
from tmtccmd.tc.packer import TcQueueT
from tmtccmd.ecss.tc import PusTelecommand
+from tmtccmd.utility.logger import get_console_logger
+
+LOGGER = get_console_logger()
latchup_id_dict = {
"0": "0.85V",
@@ -60,9 +63,11 @@ class SupvActionIds:
SET_GPIO = 34
READ_GPIO = 35
RESTART_SUPERVISOR = 36
- FACTORY_RESET = 37
+ FACTORY_RESET_CLEAR_ALL = 37
REQUEST_LOGGING_DATA = 38
UPDATE_IMAGE_DATA = 39
+ FACTORY_RESET_CLEAR_MIRROR = 40
+ FACTORY_RESET_CLEAR_CIRCULAR = 41
class SupvHkIds:
@@ -242,6 +247,36 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = pack_set_debug_verbosity_cmd(object_id)
command = PusTelecommand(service=8, subservice=128, ssc=49, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "35":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set GPIO command"))
+ command = pack_set_gpio_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=50, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "36":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Read GPIO command"))
+ command = pack_read_gpio_cmd(object_id)
+ command = PusTelecommand(service=8, subservice=128, ssc=51, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "37":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor"))
+ command = command = object_id + struct.pack('!I', SupvActionIds.RESTART_SUPERVISOR)
+ command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "38":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all"))
+ command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_ALL)
+ command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "39":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear mirror entries"))
+ command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_MIRROR)
+ command = PusTelecommand(service=8, subservice=128, ssc=54, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "40":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear circular entries"))
+ command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_CIRCULAR)
+ command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@@ -488,17 +523,56 @@ def pack_print_cpu_stats_cmd(object_id: bytearray) -> bytearray:
def pack_set_debug_verbosity_cmd(object_id: bytearray) -> bytearray:
command = bytearray()
- print("Specify debug verbosity")
- verbosity_options_dict = {
- 0: "None",
- 1: "Error",
- 2: "Warn",
- 3: "Info",
- }
- print("{:<6} | {}".format('Key', 'Description'))
- for entry in verbosity_options_dict.items():
- print("{:<6} | {}".format(entry[0], entry[1]))
- verbosity = int(input("Specify verbosity key: "))
+ verbosity = get_debug_verbosity()
command = object_id + struct.pack('!I', SupvActionIds.SET_DBG_VERBOSITY)
command = command + struct.pack('!B', verbosity)
- return command
\ No newline at end of file
+ return command
+
+
+def get_debug_verbosity() -> int:
+ tries = 0
+ while tries < 3:
+ try:
+ print("Debug verbosity options")
+ verbosity_options_dict = {
+ 0: "None",
+ 1: "Error",
+ 2: "Warn",
+ 3: "Info",
+ }
+ print("{:<6} | {}".format('Key', 'Description'))
+ for entry in verbosity_options_dict.items():
+ print("{:<6} | {}".format(entry[0], entry[1]))
+ verbosity = int(input("Specify verbosity key: "))
+ if verbosity > len(verbosity_options_dict) - 1:
+ raise ValueError
+ return verbosity
+ except ValueError:
+ LOGGER.warning("Invalid verbosity key specified")
+ tries = tries + 1
+ LOGGER.error("get_debug_verbosity: Exceeded max tries to input verbosity key")
+ quit()
+
+
+def pack_set_gpio_cmd(object_id: bytearray) -> bytearray:
+ port = int(input("Specify port: "))
+ pin = int(input("Specify pin: "))
+ val = int(input("Specify val: "))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SET_GPIO)
+ command = command + struct.pack('!B', port)
+ command = command + struct.pack('!B', pin)
+ command = command + struct.pack('!B', val)
+ return command
+
+
+def pack_read_gpio_cmd(object_id: bytearray) -> bytearray:
+ port = int(input("Specify port: "))
+ pin = int(input("Specify pin: "))
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.READ_GPIO)
+ command = command + struct.pack('!B', port)
+ command = command + struct.pack('!B', pin)
+ return command
+
+
--
2.34.1
From bc32472d88a0d7a1566f53c05a1bc49f3c377985 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Tue, 3 Aug 2021 15:28:28 +0200
Subject: [PATCH 14/21] added reboot command
---
.idea/runConfigurations/ACU_Test_UDP.xml | 24 ++++
...nt_Heater_Test_UDP.xml => Heater_Test.xml} | 2 +-
...pole.xml => IMTQ_Get_Commanded_Dipole.xml} | 2 +-
...MTQ_Neg_X_Test.xml => IMTQ_Neg_X_Test.xml} | 2 +-
...MTQ_Neg_Y_Test.xml => IMTQ_Neg_Y_Test.xml} | 2 +-
...MTQ_Neg_Z_Test.xml => IMTQ_Neg_Z_Test.xml} | 2 +-
...MTQ_Pos_X_Test.xml => IMTQ_Pos_X_Test.xml} | 2 +-
...MTQ_Pos_Y_Test.xml => IMTQ_Pos_Y_Test.xml} | 2 +-
...MTQ_Pos_Z_Test.xml => IMTQ_Pos_Z_Test.xml} | 2 +-
...nt_IMTQ_Test_UDP.xml => IMTQ_Test_UDP.xml} | 2 +-
...ock_Test_UDP.xml => P60_Dock_Test_UDP.xml} | 2 +-
...nt_PDU1_Test_UDP.xml => PDU1_Test_UDP.xml} | 2 +-
...nt_PDU2_Test_UDP.xml => PDU2_Test_UDP.xml} | 2 +-
.idea/runConfigurations/PLOC_SUPV_Test.xml | 2 +-
..._Flatsat.xml => PLOC_Test_UDP_Flatsat.xml} | 2 +-
.../runConfigurations/PLOC_Test_UDP_Local.xml | 24 ++++
.idea/runConfigurations/RW1_Test.xml | 6 +-
.idea/runConfigurations/RW2_Test_.xml | 6 +-
.idea/runConfigurations/RW3_Test_.xml | 6 +-
.idea/runConfigurations/RW4_Test_.xml | 6 +-
...c_Listener_Mode_UDP.xml => Reboot_0_0.xml} | 4 +-
.idea/runConfigurations/Reboot_0_1.xml | 24 ++++
.idea/runConfigurations/Reboot_1_0.xml | 24 ++++
.idea/runConfigurations/Reboot_1_1.xml | 24 ++++
.idea/runConfigurations/Reboot_Prompt.xml | 24 ++++
.idea/runConfigurations/Reboot_Self.xml | 24 ++++
...st_UDP.xml => S_A_Deployment_Test_UDP.xml} | 4 +-
...nks_Test_UDP.xml => Syrlinks_Test_UDP.xml} | 2 +-
...st_UDP.xml => TMP1075_1_Dock_Test_UDP.xml} | 2 +-
...st_UDP.xml => TMP1075_2_Dock_Test_UDP.xml} | 2 +-
...nd_Dipole.xml => _IMTQ_Command_Dipole.xml} | 2 +-
...vice_2_UDP.xml => tmtcc_Listener_Mode.xml} | 4 +-
...ervice_17_UDP.xml => tmtcc_Service_17.xml} | 2 +-
.idea/runConfigurations/tmtcc_Service_2.xml | 24 ++++
...vice_200_UDP.xml => tmtcc_Service_200.xml} | 2 +-
..._Service_3_UDP.xml => tmtcc_Service_3.xml} | 2 +-
..._Service_8_UDP.xml => tmtcc_Service_8.xml} | 2 +-
.../tmtcclient_PLOC_Test_UDP_Local.xml | 24 ----
.../tmtcclient_S_A_Deployment_Test_UDP.xml | 24 ----
config/definitions.py | 1 +
config/hook_implementations.py | 27 +++--
config/object_ids.py | 2 +
pus_tc/acu.py | 18 ++-
pus_tc/core.py | 112 ++++++++++++++++++
pus_tc/tc_packer_hook.py | 4 +-
tmtccmd | 2 +-
46 files changed, 382 insertions(+), 104 deletions(-)
create mode 100644 .idea/runConfigurations/ACU_Test_UDP.xml
rename .idea/runConfigurations/{tmtcclient_Heater_Test_UDP.xml => Heater_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Get_Commanded_Dipole.xml => IMTQ_Get_Commanded_Dipole.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Neg_X_Test.xml => IMTQ_Neg_X_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Neg_Y_Test.xml => IMTQ_Neg_Y_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Neg_Z_Test.xml => IMTQ_Neg_Z_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Pos_X_Test.xml => IMTQ_Pos_X_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Pos_Y_Test.xml => IMTQ_Pos_Y_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Pos_Z_Test.xml => IMTQ_Pos_Z_Test.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Test_UDP.xml => IMTQ_Test_UDP.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_P60_Dock_Test_UDP.xml => P60_Dock_Test_UDP.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_PDU1_Test_UDP.xml => PDU1_Test_UDP.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_PDU2_Test_UDP.xml => PDU2_Test_UDP.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_PLOC_Test_UDP_Flatsat.xml => PLOC_Test_UDP_Flatsat.xml} (86%)
create mode 100644 .idea/runConfigurations/PLOC_Test_UDP_Local.xml
rename .idea/runConfigurations/{tmtcc_Listener_Mode_UDP.xml => Reboot_0_0.xml} (82%)
create mode 100644 .idea/runConfigurations/Reboot_0_1.xml
create mode 100644 .idea/runConfigurations/Reboot_1_0.xml
create mode 100644 .idea/runConfigurations/Reboot_1_1.xml
create mode 100644 .idea/runConfigurations/Reboot_Prompt.xml
create mode 100644 .idea/runConfigurations/Reboot_Self.xml
rename .idea/runConfigurations/{tmtcclient_ACU_Test_UDP.xml => S_A_Deployment_Test_UDP.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_Syrlinks_Test_UDP.xml => Syrlinks_Test_UDP.xml} (87%)
rename .idea/runConfigurations/{tmtcclient_TMP1075_1_Dock_Test_UDP.xml => TMP1075_1_Dock_Test_UDP.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_TMP1075_2_Dock_Test_UDP.xml => TMP1075_2_Dock_Test_UDP.xml} (86%)
rename .idea/runConfigurations/{tmtcclient_IMTQ_Command_Dipole.xml => _IMTQ_Command_Dipole.xml} (86%)
rename .idea/runConfigurations/{tmtcc_Service_2_UDP.xml => tmtcc_Listener_Mode.xml} (88%)
rename .idea/runConfigurations/{tmtcc_Service_17_UDP.xml => tmtcc_Service_17.xml} (87%)
create mode 100644 .idea/runConfigurations/tmtcc_Service_2.xml
rename .idea/runConfigurations/{tmtcc_Service_200_UDP.xml => tmtcc_Service_200.xml} (87%)
rename .idea/runConfigurations/{tmtcc_Service_3_UDP.xml => tmtcc_Service_3.xml} (87%)
rename .idea/runConfigurations/{tmtcc_Service_8_UDP.xml => tmtcc_Service_8.xml} (87%)
delete mode 100644 .idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml
delete mode 100644 .idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml
create mode 100644 pus_tc/core.py
diff --git a/.idea/runConfigurations/ACU_Test_UDP.xml b/.idea/runConfigurations/ACU_Test_UDP.xml
new file mode 100644
index 0000000..e44f65c
--- /dev/null
+++ b/.idea/runConfigurations/ACU_Test_UDP.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml b/.idea/runConfigurations/Heater_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml
rename to .idea/runConfigurations/Heater_Test.xml
index a5895ff..6debe25 100644
--- a/.idea/runConfigurations/tmtcclient_Heater_Test_UDP.xml
+++ b/.idea/runConfigurations/Heater_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml b/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml
rename to .idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
index 7da3192..d77c885 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Get_Commanded_Dipole.xml
+++ b/.idea/runConfigurations/IMTQ_Get_Commanded_Dipole.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml b/.idea/runConfigurations/IMTQ_Neg_X_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml
rename to .idea/runConfigurations/IMTQ_Neg_X_Test.xml
index ae172c6..eec3e30 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_X_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_X_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml b/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml
rename to .idea/runConfigurations/IMTQ_Neg_Y_Test.xml
index 7a9c86d..c8e3250 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Y_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_Y_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml b/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml
rename to .idea/runConfigurations/IMTQ_Neg_Z_Test.xml
index 5319fbe..d2cba27 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Neg_Z_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Neg_Z_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml b/.idea/runConfigurations/IMTQ_Pos_X_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml
rename to .idea/runConfigurations/IMTQ_Pos_X_Test.xml
index 2e73364..6d75c92 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_X_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_X_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml b/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml
rename to .idea/runConfigurations/IMTQ_Pos_Y_Test.xml
index d3a129d..fb8e104 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Y_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_Y_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml b/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml
rename to .idea/runConfigurations/IMTQ_Pos_Z_Test.xml
index 73fcd50..98f8f4b 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Pos_Z_Test.xml
+++ b/.idea/runConfigurations/IMTQ_Pos_Z_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml b/.idea/runConfigurations/IMTQ_Test_UDP.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml
rename to .idea/runConfigurations/IMTQ_Test_UDP.xml
index 6413dc4..318b97a 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Test_UDP.xml
+++ b/.idea/runConfigurations/IMTQ_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_P60_Dock_Test_UDP.xml b/.idea/runConfigurations/P60_Dock_Test_UDP.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_P60_Dock_Test_UDP.xml
rename to .idea/runConfigurations/P60_Dock_Test_UDP.xml
index 49c15a5..8e873b7 100644
--- a/.idea/runConfigurations/tmtcclient_P60_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/P60_Dock_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_PDU1_Test_UDP.xml b/.idea/runConfigurations/PDU1_Test_UDP.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_PDU1_Test_UDP.xml
rename to .idea/runConfigurations/PDU1_Test_UDP.xml
index 3c6859b..22ea5c2 100644
--- a/.idea/runConfigurations/tmtcclient_PDU1_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU1_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_PDU2_Test_UDP.xml b/.idea/runConfigurations/PDU2_Test_UDP.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_PDU2_Test_UDP.xml
rename to .idea/runConfigurations/PDU2_Test_UDP.xml
index c640826..fbf8adf 100644
--- a/.idea/runConfigurations/tmtcclient_PDU2_Test_UDP.xml
+++ b/.idea/runConfigurations/PDU2_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/PLOC_SUPV_Test.xml
index 843dd32..cd4ce6f 100644
--- a/.idea/runConfigurations/PLOC_SUPV_Test.xml
+++ b/.idea/runConfigurations/PLOC_SUPV_Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml b/.idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml
rename to .idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml
index 81d46a6..cdfbdc6 100644
--- a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Flatsat.xml
+++ b/.idea/runConfigurations/PLOC_Test_UDP_Flatsat.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/PLOC_Test_UDP_Local.xml b/.idea/runConfigurations/PLOC_Test_UDP_Local.xml
new file mode 100644
index 0000000..09ce41b
--- /dev/null
+++ b/.idea/runConfigurations/PLOC_Test_UDP_Local.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/RW1_Test.xml b/.idea/runConfigurations/RW1_Test.xml
index c013f3d..e297519 100644
--- a/.idea/runConfigurations/RW1_Test.xml
+++ b/.idea/runConfigurations/RW1_Test.xml
@@ -1,14 +1,14 @@
-
+
-
+
-
+
diff --git a/.idea/runConfigurations/RW2_Test_.xml b/.idea/runConfigurations/RW2_Test_.xml
index cd2434f..bfa97e4 100644
--- a/.idea/runConfigurations/RW2_Test_.xml
+++ b/.idea/runConfigurations/RW2_Test_.xml
@@ -1,14 +1,14 @@
-
+
-
+
-
+
diff --git a/.idea/runConfigurations/RW3_Test_.xml b/.idea/runConfigurations/RW3_Test_.xml
index 6c98750..570dc53 100644
--- a/.idea/runConfigurations/RW3_Test_.xml
+++ b/.idea/runConfigurations/RW3_Test_.xml
@@ -1,14 +1,14 @@
-
+
-
+
-
+
diff --git a/.idea/runConfigurations/RW4_Test_.xml b/.idea/runConfigurations/RW4_Test_.xml
index e48dc3b..f2c0917 100644
--- a/.idea/runConfigurations/RW4_Test_.xml
+++ b/.idea/runConfigurations/RW4_Test_.xml
@@ -1,14 +1,14 @@
-
+
-
+
-
+
diff --git a/.idea/runConfigurations/tmtcc_Listener_Mode_UDP.xml b/.idea/runConfigurations/Reboot_0_0.xml
similarity index 82%
rename from .idea/runConfigurations/tmtcc_Listener_Mode_UDP.xml
rename to .idea/runConfigurations/Reboot_0_0.xml
index 1273551..5ded074 100644
--- a/.idea/runConfigurations/tmtcc_Listener_Mode_UDP.xml
+++ b/.idea/runConfigurations/Reboot_0_0.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/.idea/runConfigurations/Reboot_0_1.xml b/.idea/runConfigurations/Reboot_0_1.xml
new file mode 100644
index 0000000..31348ba
--- /dev/null
+++ b/.idea/runConfigurations/Reboot_0_1.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Reboot_1_0.xml b/.idea/runConfigurations/Reboot_1_0.xml
new file mode 100644
index 0000000..c635a7e
--- /dev/null
+++ b/.idea/runConfigurations/Reboot_1_0.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Reboot_1_1.xml b/.idea/runConfigurations/Reboot_1_1.xml
new file mode 100644
index 0000000..11e12bf
--- /dev/null
+++ b/.idea/runConfigurations/Reboot_1_1.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Reboot_Prompt.xml b/.idea/runConfigurations/Reboot_Prompt.xml
new file mode 100644
index 0000000..8d7f4b5
--- /dev/null
+++ b/.idea/runConfigurations/Reboot_Prompt.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Reboot_Self.xml b/.idea/runConfigurations/Reboot_Self.xml
new file mode 100644
index 0000000..ec6c747
--- /dev/null
+++ b/.idea/runConfigurations/Reboot_Self.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_ACU_Test_UDP.xml b/.idea/runConfigurations/S_A_Deployment_Test_UDP.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_ACU_Test_UDP.xml
rename to .idea/runConfigurations/S_A_Deployment_Test_UDP.xml
index 3c13fbb..4e5633e 100644
--- a/.idea/runConfigurations/tmtcclient_ACU_Test_UDP.xml
+++ b/.idea/runConfigurations/S_A_Deployment_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml b/.idea/runConfigurations/Syrlinks_Test_UDP.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml
rename to .idea/runConfigurations/Syrlinks_Test_UDP.xml
index d3eb8eb..83cc53f 100644
--- a/.idea/runConfigurations/tmtcclient_Syrlinks_Test_UDP.xml
+++ b/.idea/runConfigurations/Syrlinks_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml b/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml
rename to .idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
index 2670a02..0232820 100644
--- a/.idea/runConfigurations/tmtcclient_TMP1075_1_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/TMP1075_1_Dock_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml b/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml
rename to .idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
index d1043e9..65b4efb 100644
--- a/.idea/runConfigurations/tmtcclient_TMP1075_2_Dock_Test_UDP.xml
+++ b/.idea/runConfigurations/TMP1075_2_Dock_Test_UDP.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml b/.idea/runConfigurations/_IMTQ_Command_Dipole.xml
similarity index 86%
rename from .idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml
rename to .idea/runConfigurations/_IMTQ_Command_Dipole.xml
index e532c40..7972ab7 100644
--- a/.idea/runConfigurations/tmtcclient_IMTQ_Command_Dipole.xml
+++ b/.idea/runConfigurations/_IMTQ_Command_Dipole.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_2_UDP.xml b/.idea/runConfigurations/tmtcc_Listener_Mode.xml
similarity index 88%
rename from .idea/runConfigurations/tmtcc_Service_2_UDP.xml
rename to .idea/runConfigurations/tmtcc_Listener_Mode.xml
index fec9dac..e67c129 100644
--- a/.idea/runConfigurations/tmtcc_Service_2_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Listener_Mode.xml
@@ -1,5 +1,5 @@
-
+
@@ -13,7 +13,7 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_17_UDP.xml b/.idea/runConfigurations/tmtcc_Service_17.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcc_Service_17_UDP.xml
rename to .idea/runConfigurations/tmtcc_Service_17.xml
index 9bb6ff3..4162965 100644
--- a/.idea/runConfigurations/tmtcc_Service_17_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Service_17.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_2.xml b/.idea/runConfigurations/tmtcc_Service_2.xml
new file mode 100644
index 0000000..bd86ff4
--- /dev/null
+++ b/.idea/runConfigurations/tmtcc_Service_2.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcc_Service_200_UDP.xml b/.idea/runConfigurations/tmtcc_Service_200.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcc_Service_200_UDP.xml
rename to .idea/runConfigurations/tmtcc_Service_200.xml
index 526925e..a8d49be 100644
--- a/.idea/runConfigurations/tmtcc_Service_200_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Service_200.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_3_UDP.xml b/.idea/runConfigurations/tmtcc_Service_3.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcc_Service_3_UDP.xml
rename to .idea/runConfigurations/tmtcc_Service_3.xml
index 232d098..686dd13 100644
--- a/.idea/runConfigurations/tmtcc_Service_3_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Service_3.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcc_Service_8_UDP.xml b/.idea/runConfigurations/tmtcc_Service_8.xml
similarity index 87%
rename from .idea/runConfigurations/tmtcc_Service_8_UDP.xml
rename to .idea/runConfigurations/tmtcc_Service_8.xml
index e80b75a..698dd1f 100644
--- a/.idea/runConfigurations/tmtcc_Service_8_UDP.xml
+++ b/.idea/runConfigurations/tmtcc_Service_8.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml b/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml
deleted file mode 100644
index 409787b..0000000
--- a/.idea/runConfigurations/tmtcclient_PLOC_Test_UDP_Local.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml b/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml
deleted file mode 100644
index bd78fc6..0000000
--- a/.idea/runConfigurations/tmtcclient_S_A_Deployment_Test_UDP.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/config/definitions.py b/config/definitions.py
index 771eb06..3d5f7b4 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -29,3 +29,4 @@ class CustomServiceList(enum.Enum):
REACTION_WHEEL_4 = "reaction_wheel_4"
RAD_SENSOR = "rad_sensor"
PLOC_SUPV = "ploc_supv"
+ CORE = 'core'
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index c5bad08..46079c7 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -20,16 +20,30 @@ class EiveHookObject(TmTcHookBase):
def get_service_op_code_dictionary(self) -> ServiceOpCodeDictT:
from tmtccmd.config.globals import get_default_service_op_code_dict
service_op_code_dict = get_default_service_op_code_dict()
- op_code_dict_srv_acu = {
+ op_code_dict = {
+ 'reboot': ('Reboot with Prompt', {OpCodeDictKeys.TIMEOUT: 2.0}),
+ 'reboot_self': ('Reboot Self', {OpCodeDictKeys.TIMEOUT: 4.0}),
+ 'reboot_0_0': ('Reboot 0 0', {OpCodeDictKeys.TIMEOUT: 4.0}),
+ 'reboot_0_1': ('Reboot 0 1', {OpCodeDictKeys.TIMEOUT: 4.0}),
+ 'reboot_1_0': ('Reboot 1 0', {OpCodeDictKeys.TIMEOUT: 4.0}),
+ 'reboot_1_1': ('Reboot 1 1', {OpCodeDictKeys.TIMEOUT: 4.0}),
+ }
+ service_tuple = ('Core Controller', op_code_dict)
+ service_op_code_dict[CustomServiceList.CORE.value] = service_tuple
+
+ op_code_dict = {
"0": ("ACU Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
- service_acu_tuple = ("ACU Devices", op_code_dict_srv_acu)
+ service_tuple = ("ACU Devices", op_code_dict)
+ service_op_code_dict[CustomServiceList.ACU.value] = service_tuple
- op_code_dict_srv_tmp1075 = {
+ op_code_dict = {
"0": ("TMP1075 Tests", {OpCodeDictKeys.TIMEOUT: 2.2}),
}
- service_tmp1075_1_tuple = ("TMP1075 1", op_code_dict_srv_tmp1075)
- service_tmp1075_2_tuple = ("TMP1075 2", op_code_dict_srv_tmp1075)
+ service_tuple = ("TMP1075 1", op_code_dict)
+ service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tuple
+ service_tuple = ("TMP1075 2", op_code_dict)
+ service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
op_code_dict_srv_p60 = {
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
@@ -120,9 +134,6 @@ class EiveHookObject(TmTcHookBase):
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
- service_op_code_dict[CustomServiceList.ACU.value] = service_acu_tuple
- service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tmp1075_1_tuple
- service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tmp1075_2_tuple
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu2_tuple
diff --git a/config/object_ids.py b/config/object_ids.py
index 5d6b3e7..5537e62 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -26,6 +26,7 @@ RW4_ID = bytes([0x44, 0x12, 0x00, 0x4])
START_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
+CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
def get_object_ids() -> Dict[bytes, list]:
@@ -47,5 +48,6 @@ def get_object_ids() -> Dict[bytes, list]:
RW4_ID: "Reaction Wheel 4",
RAD_SENSOR_ID: "Radiation Sensor",
PLOC_SUPV_ID: "PLOC Supervisor",
+ CORE_CONTROLLER_ID: "Core Controller",
})
return object_id_dict
diff --git a/pus_tc/acu.py b/pus_tc/acu.py
index 9e06242..d31cba6 100644
--- a/pus_tc/acu.py
+++ b/pus_tc/acu.py
@@ -53,13 +53,17 @@ class ACUHkTable:
wdt_gnd_left = TableEntry(bytearray([0x00, 0x74]), TableEntry.uint32_size)
-def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
+def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT):
tc_queue.appendleft((QueueCommands.PRINT, "Testing ACU"))
- tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling ACU connected to X1 slot (channel 0)"))
+ tc_queue.appendleft(
+ (QueueCommands.PRINT, "P60 Dock: Enabling ACU connected to X1 slot (channel 0)")
+ )
p60dock_object_id = P60_DOCK_HANDLER
- command = pack_set_param_command(p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address,
- P60DockConfigTable.out_en_0.parameter_size, Channel.on)
+ command = pack_set_param_command(
+ p60dock_object_id, P60DockConfigTable.out_en_0.parameter_address,
+ P60DockConfigTable.out_en_0.parameter_size, Channel.on
+ )
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@@ -70,8 +74,10 @@ def pack_acu_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.read_gnd_wdt:
tc_queue.appendleft((QueueCommands.PRINT, "ACU: Reading ground watchdog timer value"))
- command = pack_get_param_command(object_id, TableIds.hk, ACUHkTable.wdt_gnd_left.parameter_address,
- ACUHkTable.wdt_gnd_left.parameter_size)
+ command = pack_get_param_command(
+ object_id, TableIds.hk, ACUHkTable.wdt_gnd_left.parameter_address,
+ ACUHkTable.wdt_gnd_left.parameter_size
+ )
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if ACUTestProcedure.all or ACUTestProcedure.gnd_wdt_reset:
diff --git a/pus_tc/core.py b/pus_tc/core.py
new file mode 100644
index 0000000..c29c6fe
--- /dev/null
+++ b/pus_tc/core.py
@@ -0,0 +1,112 @@
+import enum
+
+from tmtccmd.config.definitions import QueueCommands
+from tmtccmd.tc.definitions import TcQueueT
+from tmtccmd.tc.service_8_functional_cmd import generate_action_command
+from tmtccmd.utility.logger import get_console_logger
+from config.object_ids import CORE_CONTROLLER_ID
+
+LOGGER = get_console_logger()
+
+
+class ActionIds(enum.IntEnum):
+ REBOOT = 32
+
+
+class OpCodes(enum.Enum):
+ REBOOT = 'reboot'
+ REBOOT_SELF = 'reboot_self'
+ REBOOT_0_0 = 'reboot_0_0'
+ REBOOT_0_1 = 'reboot_0_1'
+ REBOOT_1_0 = 'reboot_1_0'
+ REBOOT_1_1 = 'reboot_1_1'
+
+
+class Chip(enum.IntEnum):
+ CHIP_0 = 0
+ CHIP_1 = 1
+ NONE = 2
+
+
+class Copy(enum.IntEnum):
+ COPY_0_NOM = 0
+ COPY_1_GOLD = 1
+ NONE = 2
+
+
+def pack_core_commands(tc_queue: TcQueueT, op_code: str):
+ if op_code == OpCodes.REBOOT.value:
+ reboot_self, chip_select, copy_select = determine_reboot_params()
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=reboot_self, chip=chip_select, copy=copy_select
+ )
+ elif op_code == OpCodes.REBOOT_SELF.value:
+ perform_reboot_cmd(tc_queue=tc_queue, reboot_self=True)
+ elif op_code == OpCodes.REBOOT_0_0.value:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_0_NOM
+ )
+ elif op_code == OpCodes.REBOOT_0_1.value:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_0, copy=Copy.COPY_1_GOLD
+ )
+ elif op_code == OpCodes.REBOOT_1_0.value:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_0_NOM
+ )
+ elif op_code == OpCodes.REBOOT_1_1.value:
+ perform_reboot_cmd(
+ tc_queue=tc_queue, reboot_self=False, chip=Chip.CHIP_1, copy=Copy.COPY_1_GOLD
+ )
+
+
+def determine_reboot_params() -> (bool, Chip, Copy):
+ chip_select = -1
+ copy_select = -1
+ reboot_self = input('Reboot self? [y/n]: ')
+ if reboot_self in ['y', 'yes', '1']:
+ LOGGER.info('Rebooting currently running image')
+ return True, chip_select, copy_select
+ LOGGER.info('Rebooting image specified by chip and copy')
+ while True:
+ chip_select = input('Chip select [0/1]: ')
+ if chip_select in ['0', '1']:
+ if chip_select == '0':
+ chip_select = Chip.CHIP_0
+ else:
+ chip_select = Chip.CHIP_1
+ break
+ else:
+ LOGGER.warning('Invalid chip select value. Try again')
+ while True:
+ copy_select = input('Copy select [0/1]: ')
+ if copy_select in ['0', '1']:
+ if copy_select == '0':
+ copy_select = Copy.COPY_0_NOM
+ else:
+ copy_select = Copy.COPY_1_GOLD
+ break
+ else:
+ LOGGER.warning('Invalid copy select value. Try again')
+ return False, chip_select, copy_select
+
+
+def perform_reboot_cmd(
+ tc_queue: TcQueueT, reboot_self: bool, chip: Chip = Chip.NONE, copy: Copy = Copy.NONE
+):
+ tc_data = bytearray()
+ if reboot_self:
+ tc_queue.appendleft((QueueCommands.PRINT, 'Packing reboot command for current image'))
+ tc_data.append(True)
+ else:
+ tc_data.append(False)
+ tc_data.append(chip)
+ tc_data.append(copy)
+ tc_queue.append(
+ (QueueCommands.PRINT, f'Packing reboot command for chip {chip} and copy {copy}')
+ )
+ action_cmd = generate_action_command(
+ object_id=CORE_CONTROLLER_ID, action_id=ActionIds.REBOOT, app_data=tc_data, ssc=0
+ )
+ tc_queue.appendleft(action_cmd.pack_command_tuple())
+
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 80d893f..ed8d6d4 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -26,6 +26,7 @@ from pus_tc.ploc_supervisor import pack_ploc_supv_test_into
from pus_tc.heater import pack_heater_test_into
from pus_tc.reaction_wheels import pack_single_rw_test_into
from pus_tc.rad_sensor import pack_rad_sensor_test_into
+from pus_tc.core import pack_core_commands
from config.definitions import CustomServiceList
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_MPSOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID, \
@@ -93,7 +94,8 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
if service == CustomServiceList.PLOC_SUPV.value:
object_id = PLOC_SUPV_ID
return pack_ploc_supv_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
-
+ if service == CustomServiceList.CORE.value:
+ return pack_core_commands(tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")
diff --git a/tmtccmd b/tmtccmd
index 2058b28..dbf6034 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit 2058b28fa167fa1cc3eb7dd69b18b4968e86ddb1
+Subproject commit dbf6034513616e447cb980efe7cf0ac255c205a4
--
2.34.1
From 3e8626bfafa561510323bf8fe3963bc2860950ed Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Wed, 4 Aug 2021 17:40:39 +0200
Subject: [PATCH 15/21] tmtccmd update
---
tmtccmd | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tmtccmd b/tmtccmd
index dbf6034..9497851 160000
--- a/tmtccmd
+++ b/tmtccmd
@@ -1 +1 @@
-Subproject commit dbf6034513616e447cb980efe7cf0ac255c205a4
+Subproject commit 94978512deb6c91a6a1456ae3a1182bf679f063a
--
2.34.1
From 36ae6a233c582a7bb7c59edaf35a64a284c7fde9 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sat, 7 Aug 2021 14:34:26 +0200
Subject: [PATCH 16/21] ploc udpater test
---
config/definitions.py | 1 +
config/hook_implementations.py | 9 ++++++
config/object_ids.py | 1 +
pus_tc/ploc_upater.py | 52 ++++++++++++++++++++++++++++++++++
pus_tc/tc_packer_hook.py | 6 +++-
5 files changed, 68 insertions(+), 1 deletion(-)
create mode 100644 pus_tc/ploc_upater.py
diff --git a/config/definitions.py b/config/definitions.py
index 771eb06..e9e11fa 100644
--- a/config/definitions.py
+++ b/config/definitions.py
@@ -29,3 +29,4 @@ class CustomServiceList(enum.Enum):
REACTION_WHEEL_4 = "reaction_wheel_4"
RAD_SENSOR = "rad_sensor"
PLOC_SUPV = "ploc_supv"
+ PLOC_UPDATER = "ploc_updater"
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 57005f4..584de70 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -126,6 +126,14 @@ class EiveHookObject(TmTcHookBase):
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
+ op_code_dict_srv_ploc_updater = {
+ "0": ("Ploc Updater: Update partion A on NVM0", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "1": ("Ploc Updater: Update partion B on NVM0", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "2": ("Ploc Updater: Update partion A on NVM1", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "3": ("Ploc Updater: Update partion B on NVM1", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ }
+ service_ploc_updater_tuple = ("Ploc Updater", op_code_dict_srv_ploc_updater)
+
service_op_code_dict[CustomServiceList.ACU.value] = service_acu_tuple
service_op_code_dict[CustomServiceList.TMP1075_1.value] = service_tmp1075_1_tuple
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tmp1075_2_tuple
@@ -140,6 +148,7 @@ class EiveHookObject(TmTcHookBase):
service_op_code_dict[CustomServiceList.REACTION_WHEEL_4.value] = service_rw_tuple
service_op_code_dict[CustomServiceList.RAD_SENSOR.value] = service_rad_sensor_tuple
service_op_code_dict[CustomServiceList.PLOC_SUPV.value] = service_ploc_supv_tuple
+ service_op_code_dict[CustomServiceList.PLOC_UPDATER.value] = service_ploc_updater_tuple
return service_op_code_dict
def get_json_config_file_path(self) -> str:
diff --git a/config/object_ids.py b/config/object_ids.py
index 5d6b3e7..b105b89 100644
--- a/config/object_ids.py
+++ b/config/object_ids.py
@@ -26,6 +26,7 @@ RW4_ID = bytes([0x44, 0x12, 0x00, 0x4])
START_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
+PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
def get_object_ids() -> Dict[bytes, list]:
diff --git a/pus_tc/ploc_upater.py b/pus_tc/ploc_upater.py
new file mode 100644
index 0000000..c2beede
--- /dev/null
+++ b/pus_tc/ploc_upater.py
@@ -0,0 +1,52 @@
+# -*- coding: utf-8 -*-
+"""
+@file ploc_supervisor.py
+@brief Tests for commanding the supervisor of the PLOC.
+ The supervisor is programmed by Thales.
+@author J. Meier
+@date 10.07.2021
+"""
+import struct
+
+from tmtccmd.config.definitions import QueueCommands
+
+from tmtccmd.tc.packer import TcQueueT
+from tmtccmd.ecss.tc import PusTelecommand
+from tmtccmd.utility.logger import get_console_logger
+
+LOGGER = get_console_logger()
+
+latchup_id_dict = {
+ "0": "0.85V",
+ "1": "1.8V",
+ "2": "MISC",
+ "3": "3.3V",
+ "4": "NVM_4XO",
+ "5": "MISSION",
+ "6": "SAFECOTS"
+}
+
+
+class UpdaterActionIds:
+ UPDATE_NVM0_A = 0
+ UPDATE_NVM0_B = 1
+ UPDATE_NVM1_A = 2
+ UPDATE_NVM1_B = 3
+
+
+class ImagePathDefs:
+ imageNvm0A = "/mnt/sd0/ploc/updateNvm0A.bin"
+
+
+def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
+ tc_queue.appendleft(
+ (QueueCommands.PRINT,
+ "Testing PLOC updater with object id: 0x" + object_id.hex())
+ )
+
+ if op_code == "0":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition A on NVM0"))
+ command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM0_A) + \
+ bytearray(ImagePathDefs.imageNvm0A, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 80d893f..dddf999 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -26,10 +26,11 @@ from pus_tc.ploc_supervisor import pack_ploc_supv_test_into
from pus_tc.heater import pack_heater_test_into
from pus_tc.reaction_wheels import pack_single_rw_test_into
from pus_tc.rad_sensor import pack_rad_sensor_test_into
+from pus_tc.ploc_upater import pack_ploc_updater_test_into
from config.definitions import CustomServiceList
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_MPSOC_ID, RW1_ID, RW2_ID, RW3_ID, RW4_ID, \
- RAD_SENSOR_ID, PLOC_SUPV_ID
+ RAD_SENSOR_ID, PLOC_SUPV_ID, PLOC_UPDATER_ID
LOGGER = get_console_logger()
@@ -93,6 +94,9 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
if service == CustomServiceList.PLOC_SUPV.value:
object_id = PLOC_SUPV_ID
return pack_ploc_supv_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
+ if service == CustomServiceList.PLOC_UPDATER.value:
+ object_id = PLOC_UPDATER_ID
+ return pack_ploc_updater_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")
--
2.34.1
From 98a1d0f856d537c64e8e29633bbd999a7395aee1 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sun, 8 Aug 2021 10:58:14 +0200
Subject: [PATCH 17/21] supervisor CAN loopback test
---
config/hook_implementations.py | 1 +
pus_tc/ploc_supervisor.py | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/config/hook_implementations.py b/config/hook_implementations.py
index 584de70..49a6726 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -123,6 +123,7 @@ class EiveHookObject(TmTcHookBase):
"38": ("PLOC Supervisor: Factory reset clear all", {OpCodeDictKeys.TIMEOUT: 2.0}),
"39": ("PLOC Supervisor: Factory reset clear mirror entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
"40": ("PLOC Supervisor: Factory reset clear circular entries", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "41": ("PLOC Supervisor: CAN loopback test", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)
diff --git a/pus_tc/ploc_supervisor.py b/pus_tc/ploc_supervisor.py
index b9a11b4..eb8a9b0 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -277,6 +277,11 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = command = object_id + struct.pack('!I', SupvActionIds.FACTORY_RESET_CLEAR_CIRCULAR)
command = PusTelecommand(service=8, subservice=128, ssc=55, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "41":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: CAN loopback test"))
+ command = command = object_id + struct.pack('!I', SupvActionIds.CAN_LOOPBACK_TEST)
+ command = PusTelecommand(service=8, subservice=128, ssc=56, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
--
2.34.1
From e7d8199e673eb204dbf0ea32158ca2f01c32aaa8 Mon Sep 17 00:00:00 2001
From: "Jakob.Meier" <meierj@irs.uni-stuttgart.de>
Date: Sun, 8 Aug 2021 15:02:29 +0200
Subject: [PATCH 18/21] ploc updater commands
---
pus_tc/ploc_upater.py | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/pus_tc/ploc_upater.py b/pus_tc/ploc_upater.py
index c2beede..2d92cfe 100644
--- a/pus_tc/ploc_upater.py
+++ b/pus_tc/ploc_upater.py
@@ -36,6 +36,9 @@ class UpdaterActionIds:
class ImagePathDefs:
imageNvm0A = "/mnt/sd0/ploc/updateNvm0A.bin"
+ imageNvm0B = "/mnt/sd0/ploc/updateNvm0B.bin"
+ imageNvm1A = "/mnt/sd0/ploc/updateNvm1A.bin"
+ imageNvm1B = "/mnt/sd0/ploc/updateNvm1B.bin"
def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@@ -50,3 +53,21 @@ def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_cod
bytearray(ImagePathDefs.imageNvm0A, 'utf-8')
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "1":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition B on NVM0"))
+ command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM0_B) + \
+ bytearray(ImagePathDefs.imageNvm0B, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "2":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition A on NVM1"))
+ command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM1_A) + \
+ bytearray(ImagePathDefs.imageNvm1A, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ if op_code == "3":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update partition B on NVM1"))
+ command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_NVM1_B) + \
+ bytearray(ImagePathDefs.imageNvm1B, 'utf-8')
+ command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
--
2.34.1
From 6824e7d8c7f3cd2f0dfc7417628d0eedb89343b8 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Mon, 9 Aug 2021 11:31:08 +0200
Subject: [PATCH 19/21] made CLI and GUI executable
---
tmtc_client_cli.py | 0
tmtc_client_gui.py | 0
2 files changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 tmtc_client_cli.py
mode change 100644 => 100755 tmtc_client_gui.py
diff --git a/tmtc_client_cli.py b/tmtc_client_cli.py
old mode 100644
new mode 100755
diff --git a/tmtc_client_gui.py b/tmtc_client_gui.py
old mode 100644
new mode 100755
--
2.34.1
From 5ea6903881fc4d84b229ea3283cfeea7bf672e54 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Mon, 9 Aug 2021 11:38:37 +0200
Subject: [PATCH 20/21] updated linter python script
---
lint.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/lint.py b/lint.py
index f0f66f0..4a42485 100755
--- a/lint.py
+++ b/lint.py
@@ -4,11 +4,20 @@ import sys
def main():
- status = os.system("flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics")
+ # Ignore folder created by venv
+ exclude_dirs_flag = '--exclude bin,lib'
+ additional_flags_both_steps = '--count --statistics'
+ additional_flags_first_step = '--select=E9,F63,F7,F82 --show-source'
+ flake8_first_step_cmd = \
+ f'flake8 . {additional_flags_both_steps} {additional_flags_first_step} {exclude_dirs_flag}'
+ status = os.system(flake8_first_step_cmd)
if os.WEXITSTATUS(status) != 0:
print("Flake8 linter errors")
sys.exit(0)
- os.system("flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics")
+ flake8_second_step_cmd = \
+ f'flake8 . {additional_flags_both_steps} --exit-zero --max-complexity=10 ' \
+ f'--max-line-length=127 {exclude_dirs_flag}'
+ os.system(flake8_second_step_cmd)
if __name__ == "__main__":
--
2.34.1
From 7c598f26a83323a9d7eef2e5f804afc0080d1190 Mon Sep 17 00:00:00 2001
From: Robin Mueller
Date: Mon, 9 Aug 2021 11:45:01 +0200
Subject: [PATCH 21/21] instructions to run linter
---
README.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/README.md b/README.md
index c52a047..d0d50c4 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,25 @@
# TMTC Commander EIVE
+# Run Linter
+
+Can be used to quickly check validity of script. Install `flake8` first
+
+```sh
+python3 -m pip install flake8
+```
+
+or on Windows
+
+```sh
+py -m pip install flake8
+```
+
+and then run the `lint.py` script
+
+```sh
+./lint.py
+```
+
# Set up virtual environment
## Linux
--
2.34.1