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