move bpx cmd defs

This commit is contained in:
2022-12-06 10:34:12 +01:00
parent 4bf3e2e5e2
commit 5745973d3d
3 changed files with 56 additions and 22 deletions

View File

@ -69,6 +69,7 @@ class OpCodes:
OFF = ["off"]
NORMAL = ["normal"]
VERIFY_BOOT = ["verify_boot"]
MODE_REPLAY = ["mode_replay"]
class Info:
@ -76,6 +77,8 @@ class Info:
OFF = "Off"
NORMAL = "Normal"
VERIFY_BOOT = "Verify boot by reading 0xdeadbeef from DEADBEEF address"
MODE_REPLAY = "Switch to REPLAY mode"
class MemAddresses(enum.IntEnum):
DEADBEEF = 0x40000004
@ -103,8 +106,8 @@ def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
oce.add("11", "Ploc MPSoC: Replay write sequence")
oce.add("12", "Ploc MPSoC: OBSW reset sequence count")
oce.add(OpCodes.VERIFY_BOOT, "Ploc MPSoC: Read DEADBEEF address")
oce.add("14", "Ploc MPSoC: Mode replay")
oce.add("15", "Ploc MPSoC: Mode idle")
oce.add(OpCodes.MODE_REPLAY, Info.MODE_REPLAY)
oce.add("15", "Ploc MPSoC: Mode IDLE")
oce.add("16", "Ploc MPSoC: Tc cam command send")
oce.add("17", "Ploc MPSoC: Set UART TX tristate")
oce.add("18", "Ploc MPSoC: Relesase UART TX")
@ -296,7 +299,6 @@ def prepare_downlink_pwr_on_cmd(object_id: bytes) -> bytearray:
def prepare_replay_write_sequence_cmd(object_id: bytes) -> bytearray:
null_terminator = 0
use_decoding = int(input("Use decoding (set to 1): "))
file = get_sequence_file()
command = (
@ -304,6 +306,7 @@ def prepare_replay_write_sequence_cmd(object_id: bytes) -> bytearray:
+ struct.pack("!I", CommandIds.TC_REPLAY_WRITE_SEQUENCE)
+ struct.pack("!B", use_decoding)
+ bytearray(file, "utf-8")
# + bytes([0])
)
return bytearray(command)