积累更新
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from crc import Calculator, Crc16
|
||||
|
||||
from tools.IntelHex import file_IntelHex_to_Bin, file_Bin_to_IntelHex
|
||||
|
||||
|
||||
Header_Tag = {
|
||||
'file_type': [0x00, 2], # 0 - 文件类型; 2byte
|
||||
@@ -183,19 +179,6 @@ def parser_version_info(file_bin: bytearray, base_addr:int):
|
||||
|
||||
return block_version
|
||||
|
||||
def test1(fp: Path):
|
||||
""" bin文件生成测试 """
|
||||
file1 = Path(fp)
|
||||
path1 = file1.parent / (file1.stem + ".bin")
|
||||
data1 = file1.read_text()
|
||||
data2 = file_IntelHex_to_Bin(data1, 0x3F0100)
|
||||
path1.write_bytes(data2)
|
||||
|
||||
# 测试Bin到IntelHex
|
||||
bin = Path(fp).read_bytes()
|
||||
result = file_Bin_to_IntelHex(bin, 0x80000, memory_width=2)
|
||||
(fp.parent / (fp.stem + ".hex")).write_text(result)
|
||||
|
||||
|
||||
def test2():
|
||||
""" 校验, 加密测试 """
|
||||
@@ -237,6 +220,6 @@ def task5():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# path_bin = Path("F:\\Work\\FPGA\\Test\\Vivado\\test_update\\test_update.vitis\\upgrade_system\\Debug\\sd_card\\BOOT.BIN")
|
||||
# GeneratePackage_Demo_Xilinx(path_bin)
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user