代码拉取完成,页面将自动刷新
#!/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')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。