Skip to content

Commit

Permalink
Fix issue with buffer write flash (filename being none instead of "")
Browse files Browse the repository at this point in the history
  • Loading branch information
bkerler committed Sep 17, 2024
1 parent f8272a4 commit 8fff2ab
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mtkclient/Library/DA/legacy/extension/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def seccfg(self, lockflag):
return False, writedata
if self.legacy.writeflash(addr=partition.sector * self.mtk.daloader.daconfig.pagesize,
length=len(writedata),
filename=None, wdata=writedata, parttype="user", display=True):
filename="", wdata=writedata, parttype="user", display=True):
return True, "Successfully wrote seccfg."
return False, "Error on writing seccfg config to flash."

Expand Down
4 changes: 2 additions & 2 deletions mtkclient/Library/DA/mtk_da_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def da_ess(self, sector: int, sectors: int, parttype: str):
wsize = min(sectorsize, 0x200000)
if self.mtk.daloader.writeflash(addr=sector * self.config.pagesize,
length=wsize,
filename=None,
filename="",
wdata=wipedata[:wsize],
parttype="user"):
print(
Expand Down Expand Up @@ -584,7 +584,7 @@ def da_es(self, partitions: list, parttype: str, sectors: int):
wsize = min(sectorsize, 0x200000)
if self.mtk.daloader.writeflash(addr=sector * self.config.pagesize,
length=wsize,
filename=None,
filename="",
wdata=wipedata[:wsize],
parttype=parttype):
print(
Expand Down
2 changes: 1 addition & 1 deletion mtkclient/Library/DA/xml/extension/v6.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ def seccfg(self, lockflag):
return False, writedata
if self.xflash.writeflash(addr=partition.sector * self.mtk.daloader.daconfig.pagesize,
length=len(writedata),
filename=None, wdata=writedata, parttype="user", display=True):
filename="", wdata=writedata, parttype="user", display=True):
return True, "Successfully wrote seccfg."
return False, "Error on writing seccfg config to flash."

Expand Down

0 comments on commit 8fff2ab

Please sign in to comment.