This commit is contained in:
pvvx 2024-12-12 07:36:09 +03:00
parent b683630d0f
commit 145a725707
19 changed files with 8 additions and 21421 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# rdwr_phy62x2.py 08.12.2024 pvvx #
# rdwr_phy62x2.py 12.12.2024 pvvx #
import serial
import time
@ -24,7 +24,7 @@ PHY_WR_BLK_SIZE = 0x2000
__progname__ = 'PHY62x2/ST17H66B Utility'
__filename__ = 'rdwr_phy62x2.py'
__version__ = "08.12.24"
__version__ = "12.12.24"
def ParseHexFile(hexfile):
try:
@ -357,24 +357,6 @@ class phyflasher:
else:
return False
return True
def EraseSectorsFlash2(self, offset = 0, size = MAX_FLASH_SIZE):
count = int((size + PHY_FLASH_SECTOR_SIZE - 1) / PHY_FLASH_SECTOR_SIZE)
offset &= PHY_FLASH_SECTOR_MASK
if count > 0 and count < 0x10000 and offset >= 0: # 1 byte .. 16 Mbytes
while count > 0:
if (offset & 0x0FFFF) == 0 and count > 15:
if not self.cmd_era64k(offset):
return False
offset += 0x10000
count-=16
else:
if not self.cmd_era4k(offset):
return False
offset += PHY_FLASH_SECTOR_SIZE
count-=1
else:
return False
return True
def send_blk(self, stream, offset, size, blkcnt, blknum):
self._port.timeout = 1
print ('Write 0x%08x bytes to Flash at 0x%08x...' % (size, offset), end = ' '),