display.py: flashing firmware

This commit is contained in:
2024-01-24 16:35:01 +01:00
parent 9d0edff2ce
commit 847685bcdc

View File

@ -293,12 +293,16 @@ if firmware:
raise ValueError(f'{firmware} is not a valid firmware file')
hwversion = d.version()
if tag[4:] == hwversion:
print('firmware is already', pretty_version(hwversion))
else:
print('firmware file:', pretty_version(tag[4:]))
# print('firmware is already', pretty_version(hwversion))
print('display version:', pretty_version(hwversion))
#d.bootmode()
#os.system(f'../stm32flash-0.7/stm32flash -R -v -b 115200 -w /tmp/fw.bin {dev}')
print('binfile version:', pretty_version(tag[4:]))
result = input('flash this (takes 1 min)? ').lower()
if result in ('y', 'yes'):
print('\ndo NOT interrupt')
d.bootmode()
d.term.close()
time.sleep(1.)
os.system(f'../stm32flash-0.7/stm32flash -R -v -b 115200 -w {firmware} {tty}')
if daemon:
while True:
d.refresh()