Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tockloader-rs: v0.1.0 release candidate #11

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

george-cosma
Copy link
Contributor

Tockloader-rs: v0.1.0 release candidate

Overview

This pull request contains all of the necessary features for an initial alpha release of tockloader-rs. Here is a comprehensive list of all major features:

  • tockloader listen implemented using ratatui, based on @CAmi307's implementation and her version of tock which adds support for a packet-based communication. See also the tock-process-console lib inside of this PR.
  • tockloader info implemented with both probe-rs and bootloader protocol.
  • tockloader list implemented with both probe-rs and bootloader protocol
  • tockloader install implemented with both probe-rs and bootloader protocol
  • tbf-parser lib based on tock's, but modified to work with non-static lifetimes

Technical Details

Inspired by probe-rs, we decided to extend the usability of tockloader from a CLI to both a CLI and a rust library which can then be used by users however they see fit. This can be useful in creating bespoke user interfaces and will aid in automation.

The tockloader-lib was designed with partial connection agnosticism in mind. This means that the library can be used with either a bootloader connection or a probe-rs connection. This is achieved by using the Connection enum. Implementation as a trait was considered, but deemed unnecessary due to the fact that the two connections are fundamentally different and would require different implementations of the same functions.

The error handling in the library is comprehensive and should provide the user with enough information to diagnose any issues that may arise. The error handling is based on the thiserror crate for the library and the anyhow crate for the CLI. In the (very near) future, we will be looking into logging to provide the user with additional information.

Future plans

Tockloader-rs is certainly not finished. Here are some of the features that we are planning to implement in the future:

  • Logging (as mentioned above)
  • Rework the bootloader-serial interface to be more modular. For the speed of development, we have copied the existing bootloader-serial code from the original tockloader, which does not integrate well with the new library.
  • More commands. The most important commands that are missing are uninstall, erase-apps, and flash IO (flash, read, write, dump-flash-page).
  • Refining and integrating CAmi307's version of tock into upstream. We want to do this in such a way that a tock installation will default to the original tockloader's protocol (dump everything on the uart as-is) and the user can opt-in to the new protocol by running a command, thus upgrading the connection to use the new protocol.

Acknowledgements

This project would not have been possible without the help of @micuami and @NegrilaRares who have worked tirelessly to get this project to where it is now. We would also like to thank @CAmi307 for her work on the new protocol and for the ratatui library which we have used to implement the tockloader listen command.

george-cosma and others added 18 commits July 12, 2024 13:27
This is a starting point for the tockloader-rs implementation.
---------

Co-authored-by: Micu Ana <[email protected]>
Co-authored-by: Negrila Rares <[email protected]>
chore: add pkg-config to prerequisites for wsl
Signed-off-by: Ana Micu <[email protected]>
Co-authored-by: Ana Micu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants