添加pg的bootram; upload flash时自动输入密码

This commit is contained in:
ranchuan
2025-08-12 16:37:36 +08:00
parent c4eee52fb9
commit 3b73d64861
3 changed files with 17 additions and 0 deletions

25
password.py Normal file
View File

@@ -0,0 +1,25 @@
import sys
from bin.crc import CRC32
def bootram_pssword(chip_id:str):
data=bytearray(b'Aerospace C.Power')
data+=bytearray(chip_id.encode('utf-8'))
off=64-len(data)
if(off>0):
data+=bytearray(b'\x5A'*off)
pss=CRC32(data)
# print(f"data={data} len={len(data)}")
print(f"bootram_pssword:{pss:08x}")
return pss
print(f"chip_id err.")
return 0
if __name__ == '__main__':
bootram_pssword(sys.argv[1])