Skip to content

Commit f525639

Browse files
committed
support EIGEN
1 parent 6d1f6c9 commit f525639

22 files changed

+235
-7
lines changed

thonnycontrib/quecpython/fw/__init__.py

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,74 @@ def wifi41DFwDownload(self):
353353
pass
354354

355355
def EigenFwDownload(self):
356-
pass
356+
tmp_path = tempfile.mkdtemp()
357+
logger.info("tmp_path: ", tmp_path)
358+
fdir1 = str(self.fw_filepath.parent)
359+
shutil.copytree(fdir1, str(Path(tmp_path) / "fw"))
360+
shutil.copytree(str(EXES_PATH / "Eigen"), str(tmp_path / "Eigen"))
361+
362+
try:
363+
config = configparser.ConfigParser(interpolation=None)
364+
logger.info('quec_download_config.ini path: {}'.format(str(Path(tmp_path) / "fw/quec_download_config.ini")))
365+
config.read(str(Path(tmp_path) / "fw/quec_download_config.ini"))
366+
File_Count = int(config.get('File', 'File_Count'))
367+
ql.set_value("File_Count", File_Count)
368+
369+
ap_application_addr = config.get('File_1', 'START_ADDR')
370+
ap_application_max = config.get('File_1', 'MAX_SIZE')
371+
ql.set_value("flexfile2", ap_application_addr + " " + ap_application_max)
372+
373+
ap_updater_addr = config.get('File_2', 'START_ADDR')
374+
ap_updater_max = config.get('File_2', 'MAX_SIZE')
375+
ql.set_value("flexfile3", ap_updater_addr + " " + ap_updater_max)
376+
377+
customer_fs_addr = config.get('File_3', 'START_ADDR')
378+
customer_fs_max = config.get('File_3', 'MAX_SIZE')
379+
ql.set_value("flexfile4", customer_fs_addr + " " + customer_fs_max)
380+
381+
if File_Count == 4:
382+
customer_backup_fs_addr = config.get('File_4', 'START_ADDR')
383+
customer_backup_fs_max = config.get('File_4', 'MAX_SIZE')
384+
385+
binpkg_config = configparser.ConfigParser(interpolation=None)
386+
binpkg_config_ini = str(Path(tmp_path) / "Eigen/config.ini")
387+
binpkg_config.read(binpkg_config_ini)
388+
389+
binpkg_config.set('package_info', 'arg_pkg_path_val', str(Path(tmp_path) / "fw" / self.fw_filepath.name))
390+
391+
binpkg_config.set('bootloader', 'blpath', str(Path(tmp_path) / "blloadskip = 0"))
392+
binpkg_config.set('system', 'syspath', str(Path(tmp_path) / "sysloadskip = 0"))
393+
binpkg_config.set('cp_system', 'cp_syspath', str(Path(tmp_path) / "cp_sysloadskip = 0"))
394+
395+
binpkg_config.set('flexfile2', 'filepath',
396+
str(Path(tmp_path) / "fw/ap_application.bin"))
397+
binpkg_config.set('flexfile2', 'burnaddr', ap_application_addr)
398+
399+
binpkg_config.set('flexfile3', 'filepath', str(Path(tmp_path) / "fw/ap_updater.bin"))
400+
binpkg_config.set('flexfile3', 'burnaddr', ap_updater_addr)
401+
402+
binpkg_config.set('flexfile4', 'filepath', str(Path(tmp_path) / "fw/customer_fs.bin"))
403+
binpkg_config.set('flexfile4', 'burnaddr', customer_fs_addr)
404+
if File_Count == 4:
405+
binpkg_config.set('flexfile5', 'filepath',
406+
str(Path(tmp_path) / "fw/customer_backup_fs.bin"))
407+
binpkg_config.set('flexfile5', 'burnaddr', customer_backup_fs_addr)
408+
else:
409+
binpkg_config.remove_section('flexfile5')
410+
411+
except Exception as e:
412+
raise Exception(tr("please check if the firmware is ok."))
413+
414+
binpkg_config = extra['binpkg_config']
415+
binpkg_config_ini = extra['binpkg_config_ini']
416+
binpkg_config.set('config', 'line_0_com', self.com_info['port'])
417+
with open(binpkg_config_ini, "w+", encoding='utf-8') as f:
418+
binpkg_config.write(f)
419+
420+
return self.fw_download(
421+
str(Path(tmp_path) / "Eigen/flashtoolcli1.exe"),
422+
str(Path(tmp_path) / "fw" / self.fw_filepath.name)
423+
)
357424

358425
def fw_download(self, download_exe_path, fw_filepath):
359426
logger.info('enter FwDownloadHandler.fw_download method.')
@@ -377,7 +444,8 @@ def fw_download(self, download_exe_path, fw_filepath):
377444
cmd = [download_exe_path, self.com_info['port'][3:], '115200', fw_filepath]
378445
logger.info('------------------BG95 download downloading factory package(mbn)------------------')
379446
elif self.platform.upper() == "EIGEN":
380-
pass
447+
cmd = [download_name, '--cfgfile ' + self.binpkg_config_ini, '--port="%s"' % comport]
448+
print('------------------Eigen downloading upgrade package(binpkg): ------------------')
381449
elif self.platform.upper() == "FCM360W":
382450
cmd = [download_exe_path, '-p', self.com_info['port'][3:], '-b', "921600", '-file', fw_filepath]
383451
print('------------------ FCM360W downloading factory package: ------------------')
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
�������ƣ�FlashToolCLI
2+
����汾��FlashToolCLI v4.0.3
3+
4+
V4.0.3
5+
20211202
6+
1.����fcelf.exe,֧���¸�ʽ����
7+
2.������image_ec618 agentboot.bin
8+
3.����������tool_basedir
9+
10+
V4.0.1
11+
20210926
12+
1.����֧��EC618��
27.9 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
H��ݔ8q�t��˖��8�2M��v_�{�����]�
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[config]
2+
line_0_com =
3+
agbaud = 115200
4+
filter_embedusb = 0
5+
filter_externcom = 1
6+
7+
[package_info]
8+
pkgflag = 1
9+
pkg_extract_exe = .\fcelf.exe
10+
arg_pkg_path_val =
11+
12+
[agentboot]
13+
tool_basedir = 1
14+
agpath = .\image_ec618\agentboot_usb\agentboot.bin
15+
16+
[storage_cfg]
17+
opt_storage_list = "cp_flash"
18+
format_path = format_ec618.json
19+
20+
[bootloader]
21+
blpath =
22+
23+
[system]
24+
syspath =
25+
burnaddr = 0x24000
26+
27+
[cp_system]
28+
cp_syspath =
29+
30+
[control]
31+
prempt_detect_time = 6
32+
reset = 2
33+
atbaud = 115200
34+
msg_waittime = 2
35+
max_preamble_cnt = 8
36+
lpc_recover_en = 0
37+
pullup_qspi = 1
38+
39+
[flexfile2]
40+
filepath =
41+
storage_type = ap_flash
42+
burnaddr = 0x200000
43+
44+
[flexfile3]
45+
filepath =
46+
storage_type = ap_flash
47+
burnaddr = 0x3b4000
48+
49+
[flexfile4]
50+
filepath =
51+
storage_type = ap_flash
52+
burnaddr =
53+
54+
[flexfile5]
55+
filepath =
56+
storage_type = ap_flash
57+
burnaddr =
58+
59+
[flexfile0]
60+
filepath =
61+
burnaddr = 0xce000
62+
storage_type = cp_flash
63+
64+
[flexfile1]
65+
filepath =
66+
burnaddr = 0xe7000
67+
storage_type = cp_flash
68+
2.06 MB
Binary file not shown.
8.33 MB
Binary file not shown.

thonnycontrib/quecpython/fw/exes/Eigen/image_ec618/.img.sync.tmp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2022-11-04 14:44:18
2+
ImageInfo:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\imagedata.json
3+
ExtractDir:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp
4+
SYNC SRC: F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp\ap_bootloader.bin
5+
SYNC TGT: E:\1_Source\QFlash_Tool\QFlash_EC600E_Open\Release\EFlashTool\1\image_ec618\ap_bootloader.bin
6+
2022-11-04 14:44:18
7+
ImageInfo:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\imagedata.json
8+
ExtractDir:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp
9+
SYNC SRC: F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp\ap_at_command.bin
10+
SYNC TGT: E:\1_Source\QFlash_Tool\QFlash_EC600E_Open\Release\EFlashTool\1\image_ec618\ap_demo-flash.bin
11+
2022-11-04 14:44:18
12+
ImageInfo:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\imagedata.json
13+
ExtractDir:F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp
14+
SYNC SRC: F:\14_Firmware\EIGEN\EC600E\EC600ECNLCR01A01M04_BETA1103\pkg_extract_tmp\cp-demo-flash.bin
15+
SYNC TGT: E:\1_Source\QFlash_Tool\QFlash_EC600E_Open\Release\EFlashTool\1\image_ec618\cp-demo-flash.bin
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)