vintagepc / MK404

A functional Simulator for Prusa (Mini/Einsy) Rambo based printers
https://vintagepc.github.io/MK404/
GNU General Public License v3.0
69 stars 9 forks source link

[BUG] Fail if firmware is not readable/usable #369

Open wavexx opened 1 year ago

wavexx commented 1 year ago

Describe the bug Running MK404 -f with a broken/missing/non-existing firmware file will still start without complaining if a previous firmware was already loaded.

If -f is provided, it should always require a existing firmware and replace the existing, resulting in a failure.

If -f provides a broken FW, and later MK404 is run without a -f flag, MK404 should stay broken.

The current behavior can lead to the user suspecting the provided FW was actually loaded, even though it didn't for whatever reason.

To Reproduce The sequence:

M404 -f working_fw
M404 -f file_does_not_exist

should result in the second to fail if the first succeeded.

M404 -f working_fw
M404 -f non_working_fw
M404

should result in both the second and third invocation to fail if the first succeeded.

vintagepc commented 1 year ago

I can definitely add a failure if the file is not found.

However, I'm not sure I understand the second request in regards to the third call also failing - "broken" firmware how? If a bad firmware is loaded into flash it will remain there and continue to be broken. Or are you proposing that if a nonexistent file is specified, that the flash space be wiped?