added commands for flash formatting
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2024-04-25 12:11:18 +02:00
parent e04b5bf9d7
commit 36d9323b57
Signed by: muellerr
GPG Key ID: A649FB78196E3849

View File

@ -90,6 +90,8 @@ class ActionId(enum.IntEnum):
TC_FLASH_READ_FULL_FILE = 30
TC_SIMPLEX_STORE_FILE = 31
TC_VERIFY_BOOT = 32
TC_ENABLE_FLASH_TC_EXECUTION = 33
TC_FLASH_MKFS = 34
class Submode(enum.IntEnum):
@ -128,6 +130,8 @@ class OpCode:
MODE_IDLE = "mode_idle"
MODE_REPLAY = "mode_replay"
MODE_SNAPSHOT = "mode_snapshot"
ENABLE_FLASH_TC_EXECUTION = "enable_flash_tc_exec"
FLASH_MKFS = "flash_mkfs"
class Info:
@ -158,6 +162,8 @@ class Info:
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = (
"Disable PLOC SUPV commanding when switching ON"
)
ENABLE_FLASH_TC_EXECUTION = "Enable execution of Flash MKFS command"
FLASH_MKFS = "Flash MKFS command"
class MemAddresses(enum.IntEnum):
@ -271,6 +277,25 @@ def pack_ploc_mpsoc_commands(
+ bytearray(cam_cmd, "utf-8")
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.ENABLE_FLASH_TC_EXECUTION:
q.add_log_cmd(Info.ENABLE_FLASH_TC_EXECUTION)
q.add_pus_tc(
create_action_cmd(PLOC_MPSOC_ID, ActionId.TC_ENABLE_FLASH_TC_EXECUTION)
)
if cmd_str == OpCode.FLASH_MKFS:
q.add_log_cmd(Info.FLASH_MKFS)
while True:
flash_select = int(input("Please select the flash ID (0 or 1): "))
if flash_select != 0 and flash_select != 1:
_LOGGER.warn("invalid flash select")
continue
break
q.add_pus_tc(
create_action_cmd(
PLOC_MPSOC_ID, ActionId.TC_FLASH_MKFS, bytes([flash_select])
)
)
if cmd_str == "17":
q.add_log_cmd("PLOC MPSoC: Set UART TX tristate")
data = object_id.as_bytes + struct.pack("!I", ActionId.SET_UART_TX_TRISTATE)