dektronics / printalyzer-timer

F-Stop enlarging timer and print exposure meter
24 stars 6 forks source link

Add features to bootloader #23

Open dkonigsberg opened 3 years ago

dkonigsberg commented 3 years ago

This is a follow-on task for #9, and mostly a tracker for wishlist features.

The initial bootloader is fairly basic, and mostly focuses just on the success path of getting a firmware image from a USB stick into flash. It means the minimum requirements, but is far from ideal. Before it can be deemed "complete and ready for primetime" there are some features that should probably be added:

The bootloader is the one component of the system that is essentially fixed in stone once the Printalyzer goes to a normal end-user, so making it "complete" prior to launch is a requirement. If that can't be done, then at least the firmware image format needs to be fixed in stone.

dkonigsberg commented 3 years ago

The bootloader should check if the selected image on the USB stick matches the already-loaded firmware, and prevent (or warn) if the user tries to reinstall. This will make things easier before actual image versioning/selection is fully implemented. Checksum verification can be used to make sure re-flashing corrupted firmware is still possible.

dkonigsberg commented 10 months ago

Several minor tweaks to the bootloader code: c20b7cc42736e02bdf5625c1c28896fdbd51f638 e451859c358f035950c923cc7c6ceae497c6218f 410bb24e9bcb13e39764709400dca801c6583abb 3d0756bd93f90e156e111c5c2fecc2ecf4b875d1 4a322cf6c6cfb84aff7d78472d3623cb75d40f19 c775bd0f646d28b603fc18bf85448c641befd60f

dkonigsberg commented 1 month ago

As work on the bootloader not all commits are being captured on this task. However, the scope of the bootloader has since changed. Originally the bootloader was given 128KB of flash, and had ample space for all of these extra features. However, this is way too much given that we only have 512KB of total flash and would rather reserve as much as possible for the actual firmware. Furthermore, adding too many bootloader features creates more opportunity for bootloader bugs, which will be almost impossible to fix once devices are shipped.

The new plan is as follows:

In other words, the bootloader can still be dumb, as long as the main firmware has a menu where a user can browse a USB thumbdrive and select an image to install.