3 Star 0 Fork 1

linkedsemi/TG7121B_SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
script.py 1.19 KB
一键复制 编辑 原始数据 按行查看 历史
Xintian Zhang 提交于 2022-02-23 14:55 +08:00 . rename to LE5010
#!/usr/bin/env python3
from intelhex import hex2bin
import os
import subprocess
import re
import shutil
hex2bin('components/chip_LE5010/ble_sdk/soc/arm_cm/le501x/bin/ll_fw_legacy.hex','boards/LE5010_evb/bootimgs/stack',0x18007000,pad=0xff)
hex2bin('components/chip_LE5010/ble_sdk/soc/arm_cm/le501x/bin/ll_fw.hex','boards/LE5010_evb/bootimgs/stack5',0x18007000,pad=0xff)
def gen_init_bin(path):
os.chdir('solutions/arm_dummy_boot_demo')
subprocess.Popen('make').wait()
os.chdir('../../')
with open(path,"wb") as out:
subprocess.Popen(['cat','boards/LE5010_evb/bootimgs/info_sbl.bin','solutions/arm_dummy_boot_demo/boot.bin',],stdout=out).wait()
gen_init_bin('boards/LE5010_evb/bootimgs/init')
shutil.copyfile('components/chip_LE5010/package.yaml','components/chip_LE5010/package.yaml.bak')
with open('components/chip_LE5010/package.yaml','r') as f:
content = f.read()
new_content = re.sub('^.+- ll_fw_legacy$',' - ll_fw',content,flags = re.MULTILINE)
with open('components/chip_LE5010/package.yaml','w') as f:
f.write(new_content)
gen_init_bin('boards/LE5010_evb/bootimgs/init5')
shutil.move('components/chip_LE5010/package.yaml.bak','components/chip_LE5010/package.yaml')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linkedsemi/tg7121b_sdk.git
git@gitee.com:linkedsemi/tg7121b_sdk.git
linkedsemi
tg7121b_sdk
TG7121B_SDK
master

搜索帮助