添加跳过下载 ram.bin 的选项
This commit is contained in:
10
kunlun.py
10
kunlun.py
@@ -344,6 +344,7 @@ def global_def():
|
||||
global log_timeout
|
||||
global layout_index
|
||||
global log_file
|
||||
global skip_ram
|
||||
args = parser.parse_args()
|
||||
|
||||
init_str="WQKL"
|
||||
@@ -353,6 +354,7 @@ def global_def():
|
||||
user_log=args.log
|
||||
log_timeout=args.timeout
|
||||
layout_index=args.layout_index
|
||||
skip_ram=args.skip_ram
|
||||
|
||||
|
||||
# 上传或者下载flash镜像
|
||||
@@ -416,6 +418,7 @@ def parser_init():
|
||||
parser.add_argument('--nb_rate',action='store',type=int,default=1500000,help='下载flash程序使用的串口波特率')
|
||||
parser.add_argument('--ftm',action='store_true',default=False,help='进入工厂模式')
|
||||
parser.add_argument('--list',action='store_true',default=False,help='列出所有.bin文件')
|
||||
parser.add_argument('--skip_ram',action='store_true',default=False,help='下载flash文件时是否跳过下载ram.bin的步骤,默认否')
|
||||
|
||||
|
||||
|
||||
@@ -437,12 +440,10 @@ if __name__ == '__main__':
|
||||
function_type=None # 功能类型 "download" 下载,"upload" 上传,"ram" 下载ram,"convert"" 转换bin
|
||||
time_stamp_start, time_stamp_end = 0, 0
|
||||
init_str, serial_com, b_rate, nb_rate, ram_file, iot_flash_file, ser = None, None, None, None, None, None, None
|
||||
upload_key=None
|
||||
parser=None
|
||||
upload_key, parser, layout_index, log_file=None, None, None, None
|
||||
user_log=False
|
||||
log_timeout=0
|
||||
layout_index=None
|
||||
log_file=None
|
||||
skip_ram=False
|
||||
parser_init()
|
||||
global_def()
|
||||
if(function_type is None):
|
||||
@@ -478,6 +479,7 @@ if __name__ == '__main__':
|
||||
|
||||
modem = xmodem.XMODEM(getc, putc, mode='xmodem1k')
|
||||
# 发送启动字符让设备进入xmodem模式
|
||||
if not skip_ram:
|
||||
init_send(ser, init_str)
|
||||
burn_ram_bin(modem, ram_file)
|
||||
|
||||
|
Reference in New Issue
Block a user