From ec8febf623a651b83c518443c30e9acfa36461fd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 10:55:08 +0200 Subject: [PATCH 1/6] add new obj ID --- eive_tmtc/config/objects.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/eive_tmtc/config/objects.csv b/eive_tmtc/config/objects.csv index 914b7df..10cfed2 100644 --- a/eive_tmtc/config/objects.csv +++ b/eive_tmtc/config/objects.csv @@ -3,6 +3,7 @@ 0x43000003;CORE_CONTROLLER 0x43000004;POWER_CONTROLLER 0x43000006;GLOBAL_JSON_CFG +0x43000007;XIPHOS_WDT 0x43400001;THERMAL_CONTROLLER 0x44120006;MGM_0_LIS3_HANDLER 0x44120010;GYRO_0_ADIS_HANDLER From 7cd1b0070aa1db624ba084ae7d3ebe76d0e7d738 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 11:35:57 +0200 Subject: [PATCH 2/6] add WDT module --- eive_tmtc/config/definitions.py | 1 + eive_tmtc/config/object_ids.py | 1 + eive_tmtc/tmtc/wdt.py | 43 +++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 eive_tmtc/tmtc/wdt.py diff --git a/eive_tmtc/config/definitions.py b/eive_tmtc/config/definitions.py index e28978e..16e4046 100644 --- a/eive_tmtc/config/definitions.py +++ b/eive_tmtc/config/definitions.py @@ -78,3 +78,4 @@ class CustomServiceList(str, enum.Enum): SYSTEM = "system" PWR_CTRL = "pwr_ctrl" EPS_SS = "eps_subsystem" + XIPHOS_WDT = "xiphos_wdt" diff --git a/eive_tmtc/config/object_ids.py b/eive_tmtc/config/object_ids.py index 016c176..af77351 100644 --- a/eive_tmtc/config/object_ids.py +++ b/eive_tmtc/config/object_ids.py @@ -159,6 +159,7 @@ TCS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x01]) ACS_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x02]) CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03]) PWR_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x04]) +XIPHOS_WDT_ID = bytes([0x43, 0x00, 0x00, 0x07]) MISC_TM_STORE = bytes([0x73, 0x02, 0x00, 0x01]) OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x02]) diff --git a/eive_tmtc/tmtc/wdt.py b/eive_tmtc/tmtc/wdt.py new file mode 100644 index 0000000..27980a8 --- /dev/null +++ b/eive_tmtc/tmtc/wdt.py @@ -0,0 +1,43 @@ +import enum +from tmtccmd.config.tmtc import ( + OpCodeEntry, + TmtcDefinitionWrapper, + tmtc_definitions_provider, +) +from tmtccmd.pus.s8_fsfw_funccmd import create_action_cmd +from tmtccmd.tc import DefaultPusQueueHelper + +from eive_tmtc.config.definitions import CustomServiceList +from eive_tmtc.config.object_ids import XIPHOS_WDT_ID + + +class OpCode: + ENABLE = "enable" + DISBALE = "disable" + + +class Info: + ENABLE = "Enable WDT" + DISABLE = "Disable WDT" + + +class ActionId(enum.IntEnum): + ENABLE = 0 + DISABLE = 1 + + +def pack_wdt_commands(q: DefaultPusQueueHelper, op_code: str): + if op_code == OpCode.ENABLE: + q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.ENABLE)) + if op_code == OpCode.DISBALE: + q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.DISABLE)) + + +@tmtc_definitions_provider +def add_health_cmd_defs(defs: TmtcDefinitionWrapper): + oce = OpCodeEntry() + oce.add(keys=OpCode.ENABLE, info=Info.ENABLE) + oce.add(keys=OpCode.ENABLE, info=Info.DISABLE) + defs.add_service( + CustomServiceList.XIPHOS_WDT, info="Xiphos Watchdog Timer", op_code_entry=oce + ) From 1123c4d4df58aa1b2b37495651774f1c68c50076 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 11:37:48 +0200 Subject: [PATCH 3/6] WDT --- eive_tmtc/tmtc/__init__.py | 1 + eive_tmtc/tmtc/wdt.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/tmtc/__init__.py b/eive_tmtc/tmtc/__init__.py index 93a44f6..618cee5 100644 --- a/eive_tmtc/tmtc/__init__.py +++ b/eive_tmtc/tmtc/__init__.py @@ -6,3 +6,4 @@ from .health import add_health_cmd_defs from .system import add_system_cmd_defs from .tm_store import add_persistent_tm_store_cmd_defs from .tcs import add_tmp_sens_cmds +from .wdt import add_xiphos_wdt_defs diff --git a/eive_tmtc/tmtc/wdt.py b/eive_tmtc/tmtc/wdt.py index 27980a8..fb63ac7 100644 --- a/eive_tmtc/tmtc/wdt.py +++ b/eive_tmtc/tmtc/wdt.py @@ -34,7 +34,7 @@ def pack_wdt_commands(q: DefaultPusQueueHelper, op_code: str): @tmtc_definitions_provider -def add_health_cmd_defs(defs: TmtcDefinitionWrapper): +def add_xiphos_wdt_defs(defs: TmtcDefinitionWrapper): oce = OpCodeEntry() oce.add(keys=OpCode.ENABLE, info=Info.ENABLE) oce.add(keys=OpCode.ENABLE, info=Info.DISABLE) From aba369f11f928aefe570f18651bd72ce98953961 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 11:38:45 +0200 Subject: [PATCH 4/6] added WDT enable and disable command --- eive_tmtc/tmtc/wdt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eive_tmtc/tmtc/wdt.py b/eive_tmtc/tmtc/wdt.py index fb63ac7..5b9d406 100644 --- a/eive_tmtc/tmtc/wdt.py +++ b/eive_tmtc/tmtc/wdt.py @@ -13,7 +13,7 @@ from eive_tmtc.config.object_ids import XIPHOS_WDT_ID class OpCode: ENABLE = "enable" - DISBALE = "disable" + DISABLE = "disable" class Info: @@ -29,7 +29,7 @@ class ActionId(enum.IntEnum): def pack_wdt_commands(q: DefaultPusQueueHelper, op_code: str): if op_code == OpCode.ENABLE: q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.ENABLE)) - if op_code == OpCode.DISBALE: + if op_code == OpCode.DISABLE: q.add_pus_tc(create_action_cmd(XIPHOS_WDT_ID, ActionId.DISABLE)) @@ -37,7 +37,7 @@ def pack_wdt_commands(q: DefaultPusQueueHelper, op_code: str): def add_xiphos_wdt_defs(defs: TmtcDefinitionWrapper): oce = OpCodeEntry() oce.add(keys=OpCode.ENABLE, info=Info.ENABLE) - oce.add(keys=OpCode.ENABLE, info=Info.DISABLE) + oce.add(keys=OpCode.DISABLE, info=Info.DISABLE) defs.add_service( CustomServiceList.XIPHOS_WDT, info="Xiphos Watchdog Timer", op_code_entry=oce ) From dcae930895b3debca5a5b615fc20cded7c3d0e89 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 14:59:56 +0200 Subject: [PATCH 5/6] disable works --- eive_tmtc/pus_tc/procedure_packer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eive_tmtc/pus_tc/procedure_packer.py b/eive_tmtc/pus_tc/procedure_packer.py index 5107979..36452bc 100644 --- a/eive_tmtc/pus_tc/procedure_packer.py +++ b/eive_tmtc/pus_tc/procedure_packer.py @@ -35,6 +35,7 @@ from eive_tmtc.tmtc.core import pack_core_commands from eive_tmtc.tmtc.acs.star_tracker import pack_star_tracker_commands from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command from eive_tmtc.tmtc.com.pdec_handler import pack_pdec_handler_test +from eive_tmtc.tmtc.wdt import pack_wdt_commands from eive_tmtc.tmtc.acs.acs_board import pack_acs_command from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.object_ids import ( @@ -205,6 +206,8 @@ def handle_default_procedure( # noqa C901: Complexity okay here. queue_helper=queue_helper, ) ) + if service == CustomServiceList.XIPHOS_WDT.value: + return pack_wdt_commands(queue_helper, op_code) if not route_to_registered_service_handlers( service, ServiceProviderParams( From eb697befe3e4429958cc3bd67bc1292eed6b3d8a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 11 Oct 2023 15:05:40 +0200 Subject: [PATCH 6/6] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ac2b3..f74eb31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +## Added + +- Xiphos WDT enable and disable command. + # [v5.7.0] 2023-10-10 - `tmtccmd` v6.0.0