通过总线下载模块程序

This commit is contained in:
ranchuan
2023-10-09 18:12:00 +08:00
parent 7f6efb9f5a
commit aa8d493581
11 changed files with 150 additions and 36 deletions

Binary file not shown.

BIN
doc/JW3425_boot_v8.bin Normal file

Binary file not shown.

View File

@@ -5,7 +5,7 @@ import json
BOOT_PATH ="JW3425_boot_v6.bin"
BOOT_PATH ="JW3425_boot_v8.bin"
APP_PATH ="MS-IEpro20231007.bin"
OUT_PATH = "jwt_program.jwt"
@@ -23,6 +23,27 @@ def arr_from_int(num:int):
return bytearray([num&0xff,(num>>8)&0xff,(num>>16)&0xff,(num>>24)&0xff])
def crc32(data:bytearray):
temp=0
crc=0xffffffff
i=0
if(len(data)%4!=0):
return 0
while(i<len(data)):
temp=data[i]|(data[i+1]<<8)|(data[i+2]<<16)|(data[i+3]<<24)
i+=4
for j in range(32):
if((crc^temp)&0x80000000)!=0:
crc=0x04c11db7^(crc<<1)
else:
crc<<=1
temp<<=1
crc&=0xffffffff
return crc
def creat():
boot=BOOT_PATH
app=APP_PATH
@@ -35,6 +56,10 @@ def creat():
d+=arr_byte_copy(0x00,0x3c7c-len(d))
d+=arr_from_int(0x55aa6699)
d+=arr_byte_copy(0x00,1024*16-len(d))
print("crc32 of all data:",hex(crc32(d)))
print("crc32 for 0x1000:",hex(crc32(d[4096:])))
with open(OUT_PATH,"wb+") as f:
f.write(d)
print(OUT_PATH+" create boot file success.")

Binary file not shown.