add SpifsInit
This commit is contained in:
parent
318b5df15f
commit
7887899e2a
2 changed files with 11 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# rdwr_phy62x2.py 20.12.2024 pvvx #
|
# rdwr_phy62x2.py 27.01.2025 pvvx #
|
||||||
|
|
||||||
import serial
|
import serial
|
||||||
import time
|
import time
|
||||||
|
|
@ -24,7 +24,7 @@ PHY_WR_BLK_SIZE = 0x2000
|
||||||
|
|
||||||
__progname__ = 'PHY62x2/ST17H66B Utility'
|
__progname__ = 'PHY62x2/ST17H66B Utility'
|
||||||
__filename__ = 'rdwr_phy62x2.py'
|
__filename__ = 'rdwr_phy62x2.py'
|
||||||
__version__ = "20.12.24"
|
__version__ = "27.01.25"
|
||||||
|
|
||||||
def ParseHexFile(hexfile):
|
def ParseHexFile(hexfile):
|
||||||
try:
|
try:
|
||||||
|
|
@ -71,6 +71,7 @@ def ParseHexFile(hexfile):
|
||||||
|
|
||||||
class phyflasher:
|
class phyflasher:
|
||||||
def __init__(self, port='COM1'):
|
def __init__(self, port='COM1'):
|
||||||
|
self.autoerase = True
|
||||||
self.old_erase_start = EXT_FLASH_ADD
|
self.old_erase_start = EXT_FLASH_ADD
|
||||||
self.old_erase_end = EXT_FLASH_ADD
|
self.old_erase_end = EXT_FLASH_ADD
|
||||||
self.port = port
|
self.port = port
|
||||||
|
|
@ -441,7 +442,7 @@ class phyflasher:
|
||||||
offset+=sblk
|
offset+=sblk
|
||||||
size-=sblk
|
size-=sblk
|
||||||
return True
|
return True
|
||||||
def HexStartSend(self):
|
def SpifsInit(self):
|
||||||
return self.write_cmd('spifs 0 1 3 0 ') and self.write_cmd('sfmod 2 2 ') and self.write_cmd('cpnum ffffffff ')
|
return self.write_cmd('spifs 0 1 3 0 ') and self.write_cmd('sfmod 2 2 ') and self.write_cmd('cpnum ffffffff ')
|
||||||
def HexfHeader(self, hp, start = DEF_START_RUN_APP_ADDR, raddr = DEF_START_WR_FLASH_ADDR):
|
def HexfHeader(self, hp, start = DEF_START_RUN_APP_ADDR, raddr = DEF_START_WR_FLASH_ADDR):
|
||||||
if len(hp) > 1:
|
if len(hp) > 1:
|
||||||
|
|
@ -619,6 +620,9 @@ def main():
|
||||||
stream.close()
|
stream.close()
|
||||||
print ('Error: Write File size = 0!')
|
print ('Error: Write File size = 0!')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
if not phy.SpifsInit():
|
||||||
|
print ('Error: Spifs start init error!')
|
||||||
|
sys.exit(2)
|
||||||
aerase = args.operation == 'we'
|
aerase = args.operation == 'we'
|
||||||
if args.erase == True or args.allerase == True:
|
if args.erase == True or args.allerase == True:
|
||||||
aerase = False
|
aerase = False
|
||||||
|
|
@ -654,7 +658,8 @@ def main():
|
||||||
if hexf == None:
|
if hexf == None:
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
hp[0][1] = hexf
|
hp[0][1] = hexf
|
||||||
if not phy.HexStartSend():
|
if not phy.SpifsInit():
|
||||||
|
print ('Error: Spifs start init error!')
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
print ('----------------------------------------------------------')
|
print ('----------------------------------------------------------')
|
||||||
aerase = True
|
aerase = True
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
python3 rdwr_phy62x2.py -p COM5 -e -r wh ./bin/BOOT_KEY2_v20.hex
|
python3 rdwr_phy62x2.py -p COM6 -e -r wh ./bin/BOOT_KEY2_v20.hex
|
||||||
@rem python3 rdwr_phy62x2.py -p COM5 -r we 0x10000 ./bin/KEY_v20.bin
|
@rem python3 rdwr_phy62x2.py -p COM6 -r we 0x10000 ./bin/KEY2_v20.bin
|
||||||
Loading…
Add table
Add a link
Reference in a new issue