From 3a8476dff20e2dd22863d96b9a6190e79088b55a Mon Sep 17 00:00:00 2001 From: Dan Green Date: Wed, 19 Jun 2024 15:15:30 -0700 Subject: [PATCH] Extend fsbl script to create MP25x FSBL header --- fsbl_header.py | 106 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 30 deletions(-) mode change 100644 => 100755 fsbl_header.py diff --git a/fsbl_header.py b/fsbl_header.py old mode 100644 new mode 100755 index 1e37d97..57439aa --- a/fsbl_header.py +++ b/fsbl_header.py @@ -1,33 +1,79 @@ +#!/usr/bin/env python3 + # From https://github.com/WerWolv/STM32MP1OS -# +import argparse import struct -import sys - -with open(sys.argv[1], "rb") as fsbl_file: - fsbl = fsbl_file.read(); - -if fsbl[:4] == b"STM2": - exit("Header already fixed") - -payload = bytearray(fsbl[0x100:]) - -header = struct.pack("