解决不能擦除flash的问题

This commit is contained in:
ranchuan
2023-10-08 18:27:10 +08:00
parent 41b36f357e
commit 7f6efb9f5a
14 changed files with 156 additions and 48 deletions

BIN
doc/JW3425_boot_v6.bin Normal file

Binary file not shown.

BIN
doc/MS-IEpro20231007.bin Normal file

Binary file not shown.

47
doc/creat_jwt_boot.py Normal file
View File

@@ -0,0 +1,47 @@
import shutil
import sys
import os
import json
BOOT_PATH ="JW3425_boot_v6.bin"
APP_PATH ="MS-IEpro20231007.bin"
OUT_PATH = "jwt_program.jwt"
# 创建离线下载器的镜像
# 填充指定个数的byte
def arr_byte_copy(byte:int,num:int):
t=bytearray()
for i in range(num):
t.append(byte)
return t
# int转数组
def arr_from_int(num:int):
return bytearray([num&0xff,(num>>8)&0xff,(num>>16)&0xff,(num>>24)&0xff])
def creat():
boot=BOOT_PATH
app=APP_PATH
d=bytearray()
with open(boot,"rb") as f:
d+=f.read()
d+=arr_byte_copy(0x00,4096-len(d))
with open(app,"rb") as f:
d+=f.read()
d+=arr_byte_copy(0x00,0x3c7c-len(d))
d+=arr_from_int(0x55aa6699)
d+=arr_byte_copy(0x00,1024*16-len(d))
with open(OUT_PATH,"wb+") as f:
f.write(d)
print(OUT_PATH+" create boot file success.")
if __name__ == "__main__":
creat()

BIN
doc/jwt_program.jwt Normal file

Binary file not shown.