Skip to content

Commit ecbe700

Browse files
committed
fix get_com_port function error and append test information for firmware download
1 parent 24916b7 commit ecbe700

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

thonnycontrib/quecpython/fw/proc.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def parse(self, line):
225225
raise Exception('Unisoc FW Download Failed.')
226226

227227

228-
class _360WExecutor(BaseExecutor):
228+
class _FCM360WExecutor(BaseExecutor):
229229

230230
def parse(self, line):
231231
try:
@@ -241,7 +241,7 @@ def parse(self, line):
241241
elif data['Status'] == 'Finished' and data['Message'] == 'Success':
242242
return line, 100
243243
else:
244-
raise Exception('360W Download Failed!')
244+
raise Exception('FCM360W Download Failed!\n{}'.format(line.strip()))
245245

246246

247247
class _EIGENExecutor(BaseExecutor):
@@ -392,7 +392,7 @@ def progress_rate(self):
392392
logger.info(line)
393393
self.parse(line)
394394
yield line, self.progress
395-
yield 100
395+
yield line, 100
396396

397397
def parse(self, line):
398398
if "RtsConditionAssign" in line:
@@ -407,19 +407,26 @@ def run_cmd(cmd, platform, cwd, **extra):
407407
logger.info('enter run_cmd method, args: {}'.format((cmd, platform, cwd,)))
408408

409409
if platform.upper() in ["ASR", "ASR1601", "ASR1606"]:
410+
# EC600M-CNLA test passed with `EC600MCNLAR01A01M08_XBND_OCPU_QPY_BETA0831`
410411
executor = _AsrExecutor(cmd, cwd)
411412
elif platform.upper() in ["UNISOC", "UNISOC8910", "UNISOC8850"]:
413+
# EG912U-GLAA test passed with `QPY_BETA0001_EG912U_GLAA_FW`
412414
executor = _UnisocExecutor(cmd, cwd)
413415
elif platform.upper() == "RDA8908A":
416+
# BC25PA test passed with `QPY_V0003_BC25PA_FW`
414417
executor = _NBExecutor(cmd, cwd)
415418
elif platform.upper() == "ASR1803S":
419+
# EC200A-EUHA test passed with `QPY_V0002_EC200A_AUHA_FW` and `QPY_V0003_EC200A_AUHA_FW`
416420
executor = _200AExecutor(cmd, cwd)
417421
elif platform.upper() == "MDM9X05":
422+
# BG95M3-LA test passed with `QPY_OCPU_BETA0002_BG95M3_FW` and `QPY_OCPU_BETA0003_BG95M3_FW`
418423
executor = _BG95Executor(cmd, cwd)
419424
elif platform.upper() == "EIGEN":
425+
# EC800E-CNLC test passed with `EC800ECNLCR02A01M04_OCPU_QPY_BETA0713`
420426
executor = _EIGENExecutor(cmd, cwd, **extra)
421427
elif platform.upper() == "FCM360W":
422-
executor = _360WExecutor(cmd, cwd)
428+
# FCM360WAAMD-OP-04 test passed with `QPY_OCPU_BETA0001_FCM360W_FW`
429+
executor = _FCM360WExecutor(cmd, cwd)
423430
else:
424431
pass
425432

thonnycontrib/quecpython/fw/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def makeCleanDir(Dir):
146146
return False
147147

148148

149-
def get_com_port(fw_file_path, platform):
149+
def get_com_port(platform):
150150
cmd = 'at+qdownload=1'
151151
fw_config = json.load(open(str(Path(__file__).with_name('fw_config.json')), 'r'))
152152
if platform.upper() in ["UNISOC", "UNISOC8910", "UNISOC8850"]:

thonnycontrib/quecpython/view.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ def list_valid_ports(self):
184184
else:
185185
self.port_combobox.current(0)
186186

187-
def get_validated_com_port(self, fw_file_path, platform):
188-
comport = get_com_port(fw_file_path, platform)
187+
def get_validated_com_port(self, platform):
188+
comport = get_com_port(platform)
189189
logger.info('detect comport is: {}'.format(comport))
190190
if comport is None:
191191
messagebox.showerror(
@@ -266,7 +266,7 @@ def download_firmware_handler(self):
266266
logger.info('fw file: {}'.format(fw_file_path))
267267
logger.info('platform: {}'.format(platform))
268268

269-
com_info = self.get_validated_com_port(fw_file_path, platform)
269+
com_info = self.get_validated_com_port(platform)
270270
if not com_info:
271271
return
272272

@@ -290,7 +290,7 @@ def update_progress(self, payload):
290290
return
291291
self.progress_stringvar.set("{}%".format(payload.data[1]))
292292
self.bar["value"] = payload.data[1]
293-
self.log_stringvar.set('{:100s}'.format(payload.data[0].strip()))
293+
self.log_stringvar.set('{:100s}'.format(payload.data[0].strip()[:100]))
294294
# self.update()
295295
elif payload.code == DownLoadFWApi.EXIT:
296296
if payload.exec:

0 commit comments

Comments
 (0)