better error handling for flashtool

This commit is contained in:
andreas 2023-11-06 17:25:03 +01:00
parent a179de5239
commit 9648901661
1 changed files with 10 additions and 7 deletions

View File

@ -94,13 +94,16 @@ class Flasher():
print("check failed")
return
imageChipId=param['info']['chipid']
chip=esptool.ESPLoader.detect_chip(param['port'])
print("Detected chip %s, id=%d"%(chip.CHIP_NAME,chip.IMAGE_CHIP_ID))
if (chip.IMAGE_CHIP_ID != imageChipId):
print("##Error: chip id in image %d does not match detected chip"%imageChipId)
return
print("Checks OK")
param['chipname']=chip.CHIP_NAME
try:
chip=esptool.ESPLoader.detect_chip(param['port'],trace_enabled=True)
print("Detected chip %s, id=%d"%(chip.CHIP_NAME,chip.IMAGE_CHIP_ID))
if (chip.IMAGE_CHIP_ID != imageChipId):
print("##Error: chip id in image %d does not match detected chip"%imageChipId)
return
print("Checks OK")
param['chipname']=chip.CHIP_NAME
except Exception as e:
print("ERROR: ",str(e))
return param
def runCheck(self,port,fileName,isFull):
param = self.checkSettings(port,fileName,isFull)