Skip to content

Commit b5481f7

Browse files
committed
update: Hidden serial port
1 parent 7e6eac1 commit b5481f7

File tree

6 files changed

+270
-255
lines changed

6 files changed

+270
-255
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# thonny_quecpython
1+
# thonny-quecpython
22
构建python源码包与二进制包
33
> python -m build

thonnycontrib/quecpython/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def __call__(self):
5555
class DownLoadFWApi(BaseApi):
5656
UPDATE_TOPIC = 'UPDATE_PROGRESS'
5757

58-
def __init__(self, firmware_file_path, comport):
58+
def __init__(self, firmware_file_path, com_info):
5959
self.firmware_file_path = firmware_file_path
60-
self.comport = comport
60+
self.com_info = com_info
6161

6262
def run(self):
63-
logger.info('enter download_firmware_api function. args: {}'.format((self.firmware_file_path, self.comport)))
64-
fw_download_handler = FwDownloadHandler(self.firmware_file_path, self.comport)
63+
logger.info('enter download_firmware_api function. args: {}'.format((self.firmware_file_path, self.com_info)))
64+
fw_download_handler = FwDownloadHandler(self.firmware_file_path, self.com_info)
6565
for data in fw_download_handler.download():
6666
self.emit(data)
6767

thonnycontrib/quecpython/fw/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ def run_cmd(cmd, process_type, cwd):
152152

153153
class FwDownloadHandler(object):
154154

155-
def __init__(self, firmware_file_path, comport):
155+
def __init__(self, firmware_file_path, com_info):
156156
self.fw_filepath = Path(firmware_file_path)
157-
self.comport = comport
157+
self.com_info = com_info
158158

159159
def download(self):
160160
logger.info('enter FwDownloadHandler.download method.')
@@ -286,19 +286,22 @@ def fw_download(self, download_exe_path, fw_filepath):
286286
logger.info('------------------unisoc downloading upgrade package------------------')
287287
downloadProcess = 'unisoc'
288288
elif self.fw_filepath.suffix == ".lod":
289-
cmd = [download_exe_path, self.comport[3:], '115200', fw_filepath]
289+
cmd = [download_exe_path, self.com_info['port'][3:], self.com_info['baudrate'], fw_filepath]
290290
logger.info('------------------NB downloading upgrade package------------------')
291291
downloadProcess = 'NB'
292292
elif self.fw_filepath.suffix == ".blf":
293293
cmd = [download_exe_path, '-f', fw_filepath]
294294
logger.info('------------------200A download downloading factory package(blf)------------------')
295295
downloadProcess = '200A'
296296
elif self.fw_filepath.suffix == ".mbn":
297-
cmd = [download_exe_path, self.comport[3:], '115200', fw_filepath]
297+
cmd = [download_exe_path, self.com_info['port'][3:], self.com_info['baudrate'], fw_filepath]
298298
logger.info('------------------BG95 download downloading factory package(mbn)------------------')
299299
downloadProcess = 'BG95'
300300
else:
301-
cmd = [download_exe_path, '-p', self.comport, '-a', '-q', '-r', '-s', '115200', fw_filepath]
301+
cmd = [
302+
download_exe_path, '-p', self.com_info['port'],
303+
'-a', '-q', '-r', '-s', self.com_info['baudrate'], fw_filepath
304+
]
302305
logger.info('------------------adownload downloading factory package------------------')
303306
downloadProcess = '"progress" :'
304307

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,116 @@
1-
{
2-
"firmware":
3-
{
4-
"pack_dir" : "mount",
5-
"mpy_dir" : "mpy",
6-
"backup_dir" : "backup",
7-
"block_size" : "4096",
8-
"read_size" : "4096",
9-
"progress_size" : "4096",
10-
"filesystem_size" : "5242880",
11-
"filesystem_backup_size" : "204800",
12-
"cnlb_filesystem_size" : "385024",
13-
"cnlb_filesystem_backup_size": "102400",
14-
"image_file_path" : "fw/images/customer_fs.bin",
15-
"image_file_backup_path" : "fw/images/customer_backup_fs.bin",
16-
"file_size" : "5MB",
17-
"file_backup_size" : "3MB",
18-
"vid_pid_work" : {"EC600SCNAA":"2C7C:6001",
19-
"EC600SCNLB":"2C7C:6002",
20-
"EC600UCNLB":"2C7C:0901",
21-
"BC25": "10C4:EA70",
22-
"EC800GCNGA": "2C7C:0904"
23-
},
24-
"vid_pid_dwload" : {"EC600SCNAA":"2ECC:3017",
25-
"EC600SCNLB":"2ECC:3004",
26-
"EC600UCNLB":"0525:A4A7",
27-
"BC25": "10C4:EA70",
28-
"EC800GCNGA": "1782:4D16"
29-
},
30-
"Quectel_ENHANCED_Port" : "x.0",
31-
"Quectel_STANDARD_Port" : "x.1",
32-
"Quectel_USB_DIAG_Port" : "x.2",
33-
"Quectel_USB_AT_Port" : "x.3",
34-
"USB_Serial_Device" : "x.5",
35-
"Quectel_Download_Port" : "2ECC:3017"
36-
},
37-
"NB":
38-
{
39-
"FS_PY_U_FLASH_START": "0x83C0000",
40-
"FS_PY_U_FLASH_SIZE": "0x20000",
41-
"FS_PY_B_FLASH_START": "0x83E0000",
42-
"FS_PY_B_FLASH_SIZE": "0x10000"
43-
},
44-
"BG95":
45-
{
46-
"BG95_FS_PY_B_FLASH_SIZE": "0x40000"
47-
},
48-
"unisoc_boards":
49-
{
50-
"CONFIG_FDL1_IMAGE_START" : { "EC200UCNAA":"0x8000c0",
51-
"EC200UCNLB":"0x8000c0",
52-
"EC200UEUAB":"0x8000c0",
53-
"EC600UCNLB":"0x8000c0",
54-
"EC600UCNLC":"0x8000c0",
55-
"EC600UEUAB":"0x8000c0"
56-
},
57-
"CONFIG_FDL1_IMAGE_SIZE" : { "EC200UCNAA":"0xff40",
58-
"EC200UCNLB":"0xff40",
59-
"EC200UEUAB":"0xff40",
60-
"EC600UCNLB":"0xff40",
61-
"EC600UCNLC":"0xff40",
62-
"EC600UEUAB":"0xff40"
63-
},
64-
"CONFIG_FDL2_IMAGE_START" : { "EC200UCNAA":"0x810000",
65-
"EC200UCNLB":"0x810000",
66-
"EC200UEUAB":"0x810000",
67-
"EC600UCNLB":"0x810000",
68-
"EC600UCNLC":"0x810000",
69-
"EC600UEUAB":"0x810000"
70-
},
71-
"CONFIG_FDL2_IMAGE_SIZE" : { "EC200UCNAA":"0x30000",
72-
"EC200UCNLB":"0x30000",
73-
"EC200UEUAB":"0x30000",
74-
"EC600UCNLB":"0x30000",
75-
"EC600UCNLC":"0x30000",
76-
"EC600UEUAB":"0x30000"
77-
},
78-
"CONFIG_FS_PY_U_FLASH_ADDRESS" : { "EC200UCNAA":"0x60420000",
79-
"EC200UCNLB":"0x60420000",
80-
"EC200UEUAB":"0x60420000",
81-
"EC600UCNLB":"0x60420000",
82-
"EC600UCNLC":"0x60420000",
83-
"EC600UEUAB":"0x60420000"
84-
},
85-
"CONFIG_FS_PY_U_FLASH_SIZE" : { "EC200UCNAA":"0x60000",
86-
"EC200UCNLB":"0x60000",
87-
"EC200UEUAB":"0x60000",
88-
"EC600UCNLB":"0x60000",
89-
"EC600UCNLC":"0x60000",
90-
"EC600UEUAB":"0x60000"
91-
},
92-
"CONFIG_FS_PY_B_FLASH_ADDRESS" : { "EC200UCNAA":"0x60480000",
93-
"EC200UCNLB":"0x60480000",
94-
"EC200UEUAB":"0x60480000",
95-
"EC600UCNLB":"0x60480000",
96-
"EC600UCNLC":"0x60480000",
97-
"EC600UEUAB":"0x60480000"
98-
},
99-
"CONFIG_FS_PY_B_FLASH_SIZE" : { "EC200UCNAA":"0x20000",
100-
"EC200UCNLB":"0x20000",
101-
"EC200UEUAB":"0x20000",
102-
"EC600UCNLB":"0x20000",
103-
"EC600UCNLC":"0x20000",
104-
"EC600UEUAB":"0x20000"
105-
}
106-
},
107-
"net_status":
108-
{
109-
"Not_Registered" : "Network registration status: Not registered",
110-
"Registered" : "Network registration status: Registered",
111-
"Registered_Denied" : "Network registration status: Registration denied",
112-
"Unknown" : "Network registration status: Unknown",
113-
"Registration_Limited" : "Network registration status: Registration limited",
114-
"Error" : "Network registration status: Error"
115-
}
116-
}
1+
{
2+
"firmware":
3+
{
4+
"pack_dir" : "mount",
5+
"mpy_dir" : "mpy",
6+
"backup_dir" : "backup",
7+
"block_size" : "4096",
8+
"read_size" : "4096",
9+
"progress_size" : "4096",
10+
"filesystem_size" : "5242880",
11+
"filesystem_backup_size" : "204800",
12+
"cnlb_filesystem_size" : "385024",
13+
"cnlb_filesystem_backup_size": "102400",
14+
"image_file_path" : "fw/images/customer_fs.bin",
15+
"image_file_backup_path" : "fw/images/customer_backup_fs.bin",
16+
"file_size" : "5MB",
17+
"file_backup_size" : "3MB",
18+
"vid_pid_work" : {"EC600SCNAA":"2C7C:6001",
19+
"EC600SCNLB":"2C7C:6002",
20+
"EC600UCNLB":"2C7C:0901",
21+
"BC25": "10C4:EA70",
22+
"EC800GCNGA": "2C7C:0904"
23+
},
24+
"vid_pid_dwload" : {"EC600SCNAA":"2ECC:3017",
25+
"EC600SCNLB":"2ECC:3004",
26+
"EC600UCNLB":"0525:A4A7",
27+
"BC25": "10C4:EA70",
28+
"EC800GCNGA": "1782:4D16"
29+
},
30+
"Quectel_ENHANCED_Port" : "x.0",
31+
"Quectel_STANDARD_Port" : "x.1",
32+
"Quectel_USB_DIAG_Port" : "x.2",
33+
"Quectel_USB_AT_Port" : "x.3",
34+
"USB_Serial_Device" : "x.5",
35+
"Quectel_Download_Port" : "2ECC:3017"
36+
},
37+
"NB":
38+
{
39+
"FS_PY_U_FLASH_START": "0x83C0000",
40+
"FS_PY_U_FLASH_SIZE": "0x20000",
41+
"FS_PY_B_FLASH_START": "0x83E0000",
42+
"FS_PY_B_FLASH_SIZE": "0x10000"
43+
},
44+
"BG95":
45+
{
46+
"BG95_FS_PY_B_FLASH_SIZE": "0x40000"
47+
},
48+
"unisoc_boards":
49+
{
50+
"CONFIG_FDL1_IMAGE_START" : { "EC200UCNAA":"0x8000c0",
51+
"EC200UCNLB":"0x8000c0",
52+
"EC200UEUAB":"0x8000c0",
53+
"EC600UCNLB":"0x8000c0",
54+
"EC600UCNLC":"0x8000c0",
55+
"EC600UEUAB":"0x8000c0"
56+
},
57+
"CONFIG_FDL1_IMAGE_SIZE" : { "EC200UCNAA":"0xff40",
58+
"EC200UCNLB":"0xff40",
59+
"EC200UEUAB":"0xff40",
60+
"EC600UCNLB":"0xff40",
61+
"EC600UCNLC":"0xff40",
62+
"EC600UEUAB":"0xff40"
63+
},
64+
"CONFIG_FDL2_IMAGE_START" : { "EC200UCNAA":"0x810000",
65+
"EC200UCNLB":"0x810000",
66+
"EC200UEUAB":"0x810000",
67+
"EC600UCNLB":"0x810000",
68+
"EC600UCNLC":"0x810000",
69+
"EC600UEUAB":"0x810000"
70+
},
71+
"CONFIG_FDL2_IMAGE_SIZE" : { "EC200UCNAA":"0x30000",
72+
"EC200UCNLB":"0x30000",
73+
"EC200UEUAB":"0x30000",
74+
"EC600UCNLB":"0x30000",
75+
"EC600UCNLC":"0x30000",
76+
"EC600UEUAB":"0x30000"
77+
},
78+
"CONFIG_FS_PY_U_FLASH_ADDRESS" : { "EC200UCNAA":"0x60420000",
79+
"EC200UCNLB":"0x60420000",
80+
"EC200UEUAB":"0x60420000",
81+
"EC600UCNLB":"0x60420000",
82+
"EC600UCNLC":"0x60420000",
83+
"EC600UEUAB":"0x60420000"
84+
},
85+
"CONFIG_FS_PY_U_FLASH_SIZE" : { "EC200UCNAA":"0x60000",
86+
"EC200UCNLB":"0x60000",
87+
"EC200UEUAB":"0x60000",
88+
"EC600UCNLB":"0x60000",
89+
"EC600UCNLC":"0x60000",
90+
"EC600UEUAB":"0x60000"
91+
},
92+
"CONFIG_FS_PY_B_FLASH_ADDRESS" : { "EC200UCNAA":"0x60480000",
93+
"EC200UCNLB":"0x60480000",
94+
"EC200UEUAB":"0x60480000",
95+
"EC600UCNLB":"0x60480000",
96+
"EC600UCNLC":"0x60480000",
97+
"EC600UEUAB":"0x60480000"
98+
},
99+
"CONFIG_FS_PY_B_FLASH_SIZE" : { "EC200UCNAA":"0x20000",
100+
"EC200UCNLB":"0x20000",
101+
"EC200UEUAB":"0x20000",
102+
"EC600UCNLB":"0x20000",
103+
"EC600UCNLC":"0x20000",
104+
"EC600UEUAB":"0x20000"
105+
}
106+
},
107+
"net_status":
108+
{
109+
"Not_Registered" : "Network registration status: Not registered",
110+
"Registered" : "Network registration status: Registered",
111+
"Registered_Denied" : "Network registration status: Registration denied",
112+
"Unknown" : "Network registration status: Unknown",
113+
"Registration_Limited" : "Network registration status: Registration limited",
114+
"Error" : "Network registration status: Error"
115+
}
116+
}

0 commit comments

Comments
 (0)