每日更新;
This commit is contained in:
@@ -158,7 +158,7 @@ def make_datafile1(file_path: str, config: dict, header_len=512):
|
||||
return data_header, data_bin, data_encrypt
|
||||
|
||||
def make_datafile2(file_path: str, config: dict, header_len=512):
|
||||
""" 升级文件生成函数 """
|
||||
""" 升级文件生成函数; 完整文件头 """
|
||||
file_path = Path(file_path)
|
||||
data_bin = file_path.read_bytes()
|
||||
md5_ctx = hashlib.md5()
|
||||
@@ -219,12 +219,12 @@ def test3():
|
||||
}
|
||||
path_bin = Path("F:\\Work\\FPGA\\Test\\Vivado\\test_update\\test_update.vitis\\upgrade_system\\Debug\\sd_card\\BOOT.BIN")
|
||||
|
||||
header, data_b, _ = make_datafile2(path_bin, config, header_len=128)
|
||||
header, data_b, _ = make_datafile2(path_bin, config, header_len=512)
|
||||
|
||||
print("Upgrade file generated successfully.")
|
||||
print(f"\t header_length={len(header)}, bin_length={len(data_b)}[{hex(len(data_b))}]")
|
||||
print(f"\t file md5: {trans_list_to_str(config['md5'])}")
|
||||
file1 = path_bin.parent / (path_bin.stem + '.dat')
|
||||
file1 = path_bin.parent / (path_bin.stem + '_h512.dat')
|
||||
file1.write_bytes(header + data_b)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user