stm8flash
stm8flash copied to clipboard
Better error handling
For all functions read/write/verify the error handling should be improved.
f.i. currently when specifying a verify operation with a byte count that is larger than part->*_size it will be silently reduced. this will result in only a partial verification of the file. i.e. stm8flash may return success even though the contents of the file does not match the contents of the IC.
- The size should be taken either from the command line or determined from the input file.
- It should be an error if size given on the command line is larger than the data in the input file.
- It should be an error if size is larger than the device size.
- both fread, srec_read and ihex_read must be checked for error condition correctly.
IMO these are two issues:
- Emit a diagnostic if the input size is larger than the device (one could consider this a bugfix)
- Add a command line option for size (this would be a new feature)