Uf2File, Reader, Writer - #4
Merged
Merged
Conversation
only for transparancy, does not compile
liamkinne
requested changes
Jul 4, 2026
liamkinne
left a comment
Member
There was a problem hiding this comment.
Please see review comments. Once those are addressed I will probably do a pass over everything to make sure all of the APIs are something I'm happy to commit to before cutting a new release.
- Change BlockError, WriterError, and ReaderError to implement core::error::Error instead of std::error::Error - Remove #[cfg(feature = "std")] gates from error implementations - Keep std-dependent I/O methods (to_writer, to_file, add_binary) gated - Gate writer tests with #[cfg(all(test, feature = "std"))] This makes the error types available in no_std environments while maintaining std-dependent functionality behind feature gates.
this is the last element for block to fulfill Uf2 spec
Contributor
Author
|
last commit does cover invalid Block Numbers (>= TotalBlockNumbers) Beyond that, there are additional requirements in the spec, I like to skip:
|
liamkinne
approved these changes
Jul 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
here is my Uf2File, Reader and Writer implementation
Unfortunately the writer feature does require std due to:
That’s probably too much for a workaround. However, Block, Uf2File and Reader do not depend on std.
I have added some synthetic UF2 test files. The
readertest, however, only reads the file – it does not check all data fields.The UF2 specification could be clearer. Some details are also ambiguous. This implementation therefore does not cover the entire specific