diff --git a/.idea/runConfigurations/PLOC_SUPV_Test.xml b/.idea/runConfigurations/PLOC_SUPV_Test.xml
index 78e9e7e..843dd32 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 95ed8ef..83c34e6 100644
--- a/config/hook_implementations.py
+++ b/config/hook_implementations.py
@@ -86,6 +86,15 @@ class EiveHookObject(TmTcHookBase):
"1": ("PLOC Supervisor: Set mode normal", {OpCodeDictKeys.TIMEOUT: 2.0}),
"2": ("PLOC Supervisor: Set mode off", {OpCodeDictKeys.TIMEOUT: 2.0}),
"3": ("PLOC Supervisor: Get HK Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "4": ("PLOC Supervisor: Restart MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "5": ("PLOC Supervisor: Start MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "6": ("PLOC Supervisor: Shutdown MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "7": ("PLOC Supervisor: Select MPSoC boot image", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "8": ("PLOC Supervisor: Set max restart tries", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "9": ("PLOC Supervisor: Reset MPSoC", {OpCodeDictKeys.TIMEOUT: 2.0}),
+ "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}),
}
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 d0ac7e2..e0f2425 100644
--- a/pus_tc/ploc_supervisor.py
+++ b/pus_tc/ploc_supervisor.py
@@ -27,6 +27,15 @@ class PlocTestProcedure:
class SupvActionIds:
HK_REPORT = 1
+ RESTART_MPSOC = 2
+ START_MPSOC = 3
+ SHUTWOWN_MPSOC = 4
+ SEL_MPSOC_BOOT_IMAGE = 5
+ SET_BOOT_TIMEOUT = 6
+ SET_MAX_RESTART_TRIES = 7
+ RESET_MPSOC = 8
+ SET_TIME_REF = 9
+ DISABLE_HK = 10
class SupvHkIds:
@@ -44,5 +53,73 @@ def pack_ploc_supv_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
command = object_id + struct.pack('!I', SupvActionIds.HK_REPORT)
command = PusTelecommand(service=8, subservice=128, ssc=20, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "4":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Restart MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.RESTART_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=21, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "5":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Start MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.START_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=22, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "6":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Shutdown MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.SHUTWOWN_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "7":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Select MPSoC boot image"))
+ mem = int(input("MEM (NVM0 - 0 or NVM1 - 1):"))
+ bp0 = int(input("BP0 (0 or 1):"))
+ bp1 = int(input("BP1 (0 or 1):"))
+ bp2 = int(input("BP2 (0 or 1):"))
+ command = pack_sel_boot_image_cmd(object_id, mem, bp0, bp1, bp2)
+ command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "8":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set max restart tries"))
+ restart_tries = int(input("Set maximum restart tries:"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_MAX_RESTART_TRIES) + struct.pack('!B', restart_tries)
+ command = PusTelecommand(service=8, subservice=128, ssc=25, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "9":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Reset MPSoC"))
+ command = object_id + struct.pack('!I', SupvActionIds.RESET_MPSOC)
+ command = PusTelecommand(service=8, subservice=128, ssc=26, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "10":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set time reference"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_TIME_REF)
+ command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ elif op_code == "11":
+ tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Set boot timeout"))
+ boot_timeout = int(input("Specify boot timeout [ms]:"))
+ command = object_id + struct.pack('!I', SupvActionIds.SET_BOOT_TIMEOUT) + struct.pack('!I', boot_timeout)
+ command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
+ tc_queue.appendleft(command.pack_command_tuple())
+ 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)
+ tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
+
+
+def pack_sel_boot_image_cmd(object_id: bytearray, mem: int, bp0: int, bp1: int, bp2: int) -> bytearray:
+ """ This function can be used to generate the command to select the image from which the MPSoC will boot
+ @param object_id The object id of the PLOC supervisor handler.
+ @param mem The memory from which the MPSoC shall boot (NVM0 - 0, NVM1 - 1)
+ @param bp0 Partition pin 0
+ @param bp1 Partition pin 1
+ @param bp2 Partition pin 2
+ """
+ command = bytearray()
+ command = object_id + struct.pack('!I', SupvActionIds.SEL_MPSOC_BOOT_IMAGE)
+ command = command + struct.pack('!B', mem)
+ command = command + struct.pack('!B', bp0)
+ command = command + struct.pack('!B', bp1)
+ command = command + struct.pack('!B', bp2)
+ return command
diff --git a/pus_tc/tc_packer_hook.py b/pus_tc/tc_packer_hook.py
index 791fa51..236740c 100644
--- a/pus_tc/tc_packer_hook.py
+++ b/pus_tc/tc_packer_hook.py
@@ -71,7 +71,7 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
return pack_imtq_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
if service == CustomServiceList.PLOC.value:
object_id = PLOC_MPSOC_ID
- return pack_ploc_test_into(object_id=object_id, tc_queue=service_queue)
+ return pack_ploc_mpsoc_test_into(object_id=object_id, tc_queue=service_queue)
if service == CustomServiceList.REACTION_WHEEL_1.value:
object_id = RW1_ID
return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)