Skip to content

zephyr: scripts: partition generator #434

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

Merged
Merged
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
16 changes: 10 additions & 6 deletions zephyr/scripts/partitions/esp_genpartition.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
start_year = 2024

scheme_default = [
("boot", "mcuboot", 128),
("boot", "mcuboot", 64),
("sys", "sys", 64),
("slot0", "image-0", -1),
("slot1", "image-1", -1),
("slot0-lpcore", "image-0-lpcore", 32),
Expand All @@ -20,7 +21,8 @@
]

scheme_amp = [
("boot", "mcuboot", 128),
("boot", "mcuboot", 64),
("sys", "sys", 64),
("slot0", "image-0", -3),
("slot1", "image-1", -3),
("slot0-appcpu", "image-0-appcpu", -1),
Expand Down Expand Up @@ -162,8 +164,8 @@ def generate_partition_table_dtsi(flash_size_mb, flash_offset_kb, scheme, scheme

with open(output_file, "w") as f:
f.write("\n".join(output))
print(f"Writing file {output_file}")

print(f"Output file: {output_file}")

def generate_default_partition_table_dtsi(flash_size_mb, flash_offset_kb, scheme_name):

Expand All @@ -185,8 +187,8 @@ def generate_default_partition_table_dtsi(flash_size_mb, flash_offset_kb, scheme

with open(output_file, "w") as f:
f.write("\n".join(output))
print(f"Writing file {output_file}")

print(f"Output file: {output_file}")

if __name__ == "__main__":

Expand All @@ -195,6 +197,8 @@ def generate_default_partition_table_dtsi(flash_size_mb, flash_offset_kb, scheme
if len(sys.argv) > 1:
output_path = sys.argv[1]

output_path = os.path.realpath(output_path)

for offset_kb in flash_offsets_kb:
for flash_mb in flash_sizes_mb:
generate_partition_table_dtsi(flash_mb, offset_kb, scheme_default, "default")
Expand Down