Refactor blethrs into a library. Add stm32-eth implementation. Prepare for supporting other stm32f devices.
#3
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.
Disclaimer: This is quite a large change and potentially a bit too much to comfortably review, however I thought I'd open a PR just in case you were interested. Feel free to ignore or close this, I'm happy to continue development on a fork if you would prefer. However, if you are interested in seeing this work land, please let me know what kinds of changes you would like to see and I'll be happy to address them. Edit: And of course, I'll update the README.
This separates the flash, bootload and command-related items of
blethrsinto a separateblethrslibrary.The original
blethrsbin target has been renamed toblethrs-binandhas been refactored to depend on the new
blethrslibrary.A new
blethrs-stm32-ethbin target has been added that demonstratesusing the
stm32-ethcrate for handling the ethernet driver andproviding the smoltcp integration.
The
UserConfig::write_to_semihostingmethod has been removed in favourof a
ufmt::uDisplayimplementation forUserConfigthat has is nowgated behind a
ufmtfeature (disabled by default).This also begins the refactoring required in order to support devices other
than the stm32f407. A module for the stm32f107 has been added however
the feature is entirely untested and currently does not compile.
Also, I've removed the
Cargo.lockas it appears that the entire workspace shares a single lock file, and I thought it best to remove it to ease development of the lib target. Perhaps it's worth removing the workspace in order to allow for a separateCargo.lockfor each of the bin targets? That said, sharing build artifacts between the three crates is nice for speeding up dev.blethrs-link
This adds a new
blethrs-linkcrate. The crate acts as a toolkit thatcan be used for communicating with a
blethrsbootloader instance.The crate benefits by sharing declared constants (such as flash
addresses, magic values and error types) with the bootloader itself via
a new
blethrs-sharedcrate.An example
demoCLI program has been added that behaves like thepython script. It should be noted that the example's
configurecommandcurrently only supports hard-coded values and does not allow for
specifying configuration parameters via CLI args.
The
blethrs-linkCRC checksum generation does not yet match the CRCgeneration performed by the STM32F407. This could potentially be solved
by copying the CRC implementation performed by
crcmodinblethrs.py.