美文网首页
python 操作nrf5x flash

python 操作nrf5x flash

作者: 嵌入式工作 | 来源:发表于2018-05-12 17:24 被阅读0次

python 操作nrf5x flash

import os

print(os.getcwd())
pth = os.getcwd()+'\\bin'
os.chdir(pth)
#p2=r"C:\Program Files (x86)\Nordic Semiconductor\nrf5x\bin"
#os.chdir(p2)

#nrfjprog -f NRF52 --eraseall
#nrfjprog -f NRF52 --program "production_final.hex" --verify
#nrfjprog -f NRF52 --rbp ALL
#nrfjprog -f NRF52 --reset


print("当前工作目录:%s"%os.getcwd())
ret=os.system("nrfjprog -f NRF52 --eraseall")
print("-----erase ret:%s"%ret)
ret=os.system("nrfjprog -f NRF52 -c 40960 --program \"1234.hex\"")
print("----program  ret:%s"%ret)
ret=os.system("nrfjprog -f NRF52  --verify  \"1234.hex\"")
print("----verity ret:%s"%ret)
ret=os.system("nrfjprog -f NRF52 --reset")
print("----reset ret:%s"%ret)

a = 10
def hi():
    print('heihei')
    if a>100:
        print('bigger')
    else:
        print('litter')

hi()


相关文章

网友评论

      本文标题:python 操作nrf5x flash

      本文链接:https://www.haomeiwen.com/subject/fqjhdftx.html