Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy storage.hex generation #106

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 1 addition & 74 deletions suit_generator/cmd_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,52 +137,13 @@ class ManifestDomain(Enum):


class EnvelopeStorage:
"""Class generating SUIT storage binary in legacy format."""
"""Base class for generating SUIT storage binary."""

ENVELOPE_SLOT_VERSION = 1
ENVELOPE_SLOT_VERSION_KEY = 0
ENVELOPE_SLOT_CLASS_ID_OFFSET_KEY = 1
ENVELOPE_SLOT_ENVELOPE_BSTR_KEY = 2

_LAYOUT = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to leave it empty, but at least leave it defined.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnvelopeStorage is a parrent class for EnvelopeStorageNrf54h20 class and uses _LAYOUT variable in some methods so it would be good to leve it empty or assign None value.

{
"role": ManifestRole.APP_ROOT,
"offset": 2048 * 0,
"size": 2048,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.APP_LOCAL_1,
"offset": 2048 * 1,
"size": 2048,
"domain": ManifestDomain.APPLICATION,
},
{
"role": ManifestRole.RAD_LOCAL_1,
"offset": 2048 * 2,
"size": 2048,
"domain": ManifestDomain.RADIO,
},
{
"role": ManifestRole.SEC_TOP,
"offset": 2048 * 3,
"size": 2048,
"domain": ManifestDomain.SECURE,
},
{
"role": ManifestRole.SEC_SDFW,
"offset": 2048 * 4,
"size": 2048,
"domain": ManifestDomain.SECURE,
},
{
"role": ManifestRole.SEC_SYSCTRL,
"offset": 2048 * 5,
"size": 2048,
"domain": ManifestDomain.SECURE,
},
]

# Default manifest role assignments
_CLASS_ROLE_ASSIGNMENTS = [
{
Expand Down Expand Up @@ -484,31 +445,6 @@ def _create_single_domain_storage_file_for_boot(
combined_hex.merge(envelopes_hex)
combined_hex.write_hex_file(dir_name + "/storage_" + domain.name.lower() + ".hex")

def _create_suit_storage_file_for_boot_legacy(
envelopes: list[SuitEnvelope],
update_candidate_info_address: int,
installed_envelope_address: int,
envelope_slot_size: int,
envelope_slot_count: int,
dir_name: str,
dfu_max_caches: int,
) -> None:
# Update candidate info
# In the boot path it is used to inform no update candidate is pending.
uci_hex = IntelHex()
uci_hex.frombytes(
ImageCreator._prepare_update_candidate_info_for_boot(dfu_max_caches), update_candidate_info_address
)

combined_hex = IntelHex(uci_hex)

storage = EnvelopeStorageNrf54h20(installed_envelope_address)
for envelope in envelopes:
storage.add_envelope(envelope)
combined_hex.merge(storage.as_intelhex())

combined_hex.write_hex_file(dir_name + "/storage.hex")

@staticmethod
def _create_suit_storage_files_for_boot(
envelopes: list[SuitEnvelope],
Expand Down Expand Up @@ -588,15 +524,6 @@ def create_files_for_boot(
envelope.sever()
envelopes.append(envelope)

ImageCreator._create_suit_storage_file_for_boot_legacy(
envelopes,
update_candidate_info_address,
envelope_address,
envelope_slot_size,
envelope_slot_count,
storage_output_directory,
dfu_max_caches,
)
ImageCreator._create_suit_storage_files_for_boot(
envelopes,
update_candidate_info_address,
Expand Down
2 changes: 1 addition & 1 deletion suit_generator/cmd_mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def add_arguments(parser):


class MpiGenerator:
"""Class geenrating SUIT Manifest Provisioning Information."""
"""Class generating SUIT Manifest Provisioning Information."""

BYTE_ORDER = "little"

Expand Down
Loading