|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
|
|
|
|
@file ploc_supervisor.py
|
|
|
|
|
@brief Tests for commanding the supervisor of the PLOC.
|
|
|
|
|
@file ploc_udpater.py
|
|
|
|
|
@brief Commands to initiate update transfer to ploc supervisor. This only updates the software of the MPSoC, it is not
|
|
|
|
|
possible to update the software of the supervisor.
|
|
|
|
|
The supervisor is programmed by Thales.
|
|
|
|
|
@author J. Meier
|
|
|
|
|
@date 10.07.2021
|
|
|
|
@ -28,17 +29,25 @@ latchup_id_dict = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class UpdaterActionIds:
|
|
|
|
|
UPDATE_NVM0_A = 0
|
|
|
|
|
UPDATE_NVM0_B = 1
|
|
|
|
|
UPDATE_NVM1_A = 2
|
|
|
|
|
UPDATE_NVM1_B = 3
|
|
|
|
|
UPDATE_A_UBOOT = 0
|
|
|
|
|
UPDATE_A_BITSTREAM = 1
|
|
|
|
|
UPDATE_A_LINUX = 2
|
|
|
|
|
UPDATE_A_APP_SW = 3
|
|
|
|
|
UPDATE_B_UBOOT = 4
|
|
|
|
|
UPDATE_B_BITSTREAM = 5
|
|
|
|
|
UPDATE_B_LINUX = 6
|
|
|
|
|
UPDATE_B_LINUX = 7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
imageAuboot = "/mnt/sd0/ploc/updateAuboot.bin"
|
|
|
|
|
imageAbitsream = "/mnt/sd0/ploc/updateAbitstream.bin"
|
|
|
|
|
imageAlinux = "/mnt/sd0/ploc/updateAlinux.bin"
|
|
|
|
|
imageAappsw = "/mnt/sd0/ploc/updateAappsw.bin"
|
|
|
|
|
imageBuboot = "/mnt/sd0/ploc/updateBuboot.bin"
|
|
|
|
|
imageBbitsream = "/mnt/sd0/ploc/updateBbitstream.bin"
|
|
|
|
|
imageBlinux = "/mnt/sd0/ploc/updateBlinux.bin"
|
|
|
|
|
imageBappsw = "/mnt/sd0/ploc/updateBappsw.bin"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
|
|
|
|
@ -48,26 +57,50 @@ def pack_ploc_updater_test_into(object_id: bytearray, tc_queue: TcQueueT, op_cod
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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')
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition A"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_A_UBOOT) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageAuboot, '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')
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition A"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_A_BITSTREAM) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageAbitsream, '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')
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition A"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_A_LINUX) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageAlinux, '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')
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update application on partition A"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_A_APP_SW) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageAappsw, 'utf-8')
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "4":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update uboot on partition B"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_B_UBOOT) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageBuboot, 'utf-8')
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=30, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "5":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update bitstream on parition B"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_B_BITSTREAM) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageBbitsream, 'utf-8')
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=31, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "6":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update linux on partition B"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_B_LINUX) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageBlinux, 'utf-8')
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|
if op_code == "7":
|
|
|
|
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Update application on partition B"))
|
|
|
|
|
command = object_id + struct.pack('!I', UpdaterActionIds.UPDATE_B_APP_SW) + \
|
|
|
|
|
bytearray(ImagePathDefs.imageBappsw, 'utf-8')
|
|
|
|
|
command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command)
|
|
|
|
|
tc_queue.appendleft(command.pack_command_tuple())
|
|
|
|
|