Firmware update: Check SW und HW version and scripts for binary creation
Opened this issue · 5 comments
in the update file and compare to running software version before flashing. As described here: https://github.com/larus-breeze/doc_larus/blob/master/documentation/can_details/definitions.md#manufacturer-and-hardware-versions
self.elf_file = ELFFile(in_stream, sys.stdout)
second parameter sys.stdout needs to be removed as script fails with
TypeError: init() takes 2 positional arguments but 3 were given
Use http://elm-chan.org/fsw/ff/doc/findfirst.html to find all *.bin images. Then loop through all *.bin images and
-
Match the hardware version in each image.
-
Search for the *.bin image with the "newest/highest software version" File name doesn't matter except for the file-ending.
-
Compare software version from newest *.bin file to the currently running version. Flash if the uSD image contains a different version.
-
No role-back protection and no Signature (authenticity) checking right know.
Where is the hardware and software version of the currently flashed image available?
It needs to be well tested that a flashed image will not be flashed again and again. This could happen if the software version detection is not robust.
The present minimalistic solution already enforces not to flash the same image again.
The GIT commit hash is placed at the beginning of the flash image, immediately behind the interrupt vectors. If this pattern is already in FLASH, the updater refuses flashing.