take boot_tiny fiels from gitlab

+ wip display firmware
This commit is contained in:
2024-01-24 15:56:19 +01:00
parent ee56015580
commit 9d0edff2ce
2 changed files with 30 additions and 7 deletions

View File

@ -80,6 +80,8 @@ class Display:
os.rename(todo_file, STARTUP_TEXT)
else:
self.storage = None
else:
os.system('systemctl stop display')
self.gethost(False)
self.reset()
if daemon:
@ -265,15 +267,38 @@ class Display:
self.send(0xf0, 0xcb, 0xef, 0x20, 0x18)
def pretty_version(v):
return '%c v%d.%d%s' % (v[0], v[2], v[3], ' test' if v[1] else '')
daemon = False
firmware = None
for arg in sys.argv[1:]:
if arg == '-d':
daemon = True
else:
elif arg.endswith('.bin'):
firmware = arg
elif tty.startswith('/dev/'):
tty = arg
else:
raise ValueError(f'do not know how to tread argument: {arg}')
d = Display(tty, daemon=daemon)
d = Display(tty, daemon=daemon and not firmware)
if firmware:
with open(firmware, 'rb') as f:
tag = f.read()[-8:]
if tag[:4] != MAGIC:
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('display version:', pretty_version(hwversion))
#d.bootmode()
#os.system(f'../stm32flash-0.7/stm32flash -R -v -b 115200 -w /tmp/fw.bin {dev}')
if daemon:
while True:
d.refresh()

View File

@ -1,11 +1,9 @@
# name of the USB stick to be created
NAME=BOOT_TINY
echo "enter ssh path of parent directory for boot_tiny, e.g. l_samenv@samenv:boxes"
read SRC
scp -r $SRC/boot_tiny ./
if [ ! -d boot_tiny ] ; then
git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git
fi
# list removeable disks
DISKS=()
while read LINE