QCC300x --OTA步骤

在sink工程目录下创建一个目录,用来存放公钥和密钥,假设目录名称为<oem_for_ota>;

在该目录下创建两个python脚本,和自动生成ota文件,这里写成脚本文件,方便每次生成OTA生级包。

gen_key.py,用来自动生成密钥,内容如下:

 

Gen_ota.py,用来生成ota文件,该脚本会自动先搜索本地目录来查找目标xuv文件,若本地目录没有.xuv文件,则自动搜索父级目录,若找到则打包ota文件,否则报错退出。

其脚本内容如下:

import os, sys,time
os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))

SRC_DIR = os.path.dirname(os.getcwd())+'\\'
CUR_DIR = os.getcwd()+'\\'
TOOL_DIR = 'C:\\ProgramFilesUser\\Qualcomm\\ADK_QCC300x.WIN.1.0.167\\tools\\bin\\'

#
# Source target file defination
#
TARGET_FILE = 'qcc3004.xuv'
UPG_FILE    = 'qcc3004.upg'
UPG_XUV_File= 'qcc3004_upg.xuv'
KEY_FILE    = 'oem.private.key'
SIGNED_FILE = 'qcc3004_upg_signed.xuv'
OTA_FILE    = 'qcc3004_upg_signed.bin'
DUMP_FILE   = 'qcc3004_dump.xuv'
AUDIO_FILE  = 'audio_prompts.xuv'

print('***********************************')
print('         Start                     ')
print('***********************************')
#
# check qcc3004.xuv file. if not exist in current folder, will check is in parent
#  folder and copy it to current folder if exist. otherwise ,will exit with 1.
#
ret = os.path.exists(CUR_DIR + TARGET_FILE)
if not ret:
    ret = os.path.exists(SRC_DIR + TARGET_FILE)
    if not ret:
        print('can not find qcc3004.xuv file.')
        exit(1)
    else:
        os.system('XCOPY /Y /F ' + SRC_DIR + TARGET_FILE +' '+ CUR_DIR)

#
# check audio_prompts.xuv file. if not exist in current folder, will check is in parent
#  folder and copy it to current folder if exist. otherwise ,will exit with 1.
#
ret = os.path.exists(CUR_DIR + AUDIO_FILE)
if not ret:
    ret = os.path.exists(SRC_DIR + AUDIO_FILE)
    if not ret:
        print('can not find '+AUDIO_FILE+' file.')
        exit(1)
    else:
        os.system('XCOPY /Y /F ' + SRC_DIR + AUDIO_FILE + ' '+CUR_DIR)

#
# generate setting files.
#
ret = os.system(TOOL_DIR+'upgradeFileGen.exe ' + CUR_DIR + UPG_FILE + ' ' + CUR_DIR + UPG_XUV_File)
ret = os.system(TOOL_DIR+'dfusign.exe -v -f -u -h '+CUR_DIR + UPG_XUV_File +' -o '+CUR_DIR + SIGNED_FILE+' -ka '+CUR_DIR + KEY_FILE)
ret = os.system(TOOL_DIR+'xuv2bin.exe -d '+CUR_DIR + SIGNED_FILE+' '+CUR_DIR + OTA_FILE)
print('*************END **********************')

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值