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
blethrs
into a separateblethrs
library.The original
blethrs
bin target has been renamed toblethrs-bin
andhas been refactored to depend on the new
blethrs
library.A new
blethrs-stm32-eth
bin target has been added that demonstratesusing the
stm32-eth
crate for handling the ethernet driver andproviding the smoltcp integration.
The
UserConfig::write_to_semihosting
method has been removed in favourof a
ufmt::uDisplay
implementation forUserConfig
that has is nowgated behind a
ufmt
feature (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.lock
as 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.lock
for 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-link
crate. The crate acts as a toolkit thatcan be used for communicating with a
blethrs
bootloader 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-shared
crate.An example
demo
CLI program has been added that behaves like thepython script. It should be noted that the example's
configure
commandcurrently only supports hard-coded values and does not allow for
specifying configuration parameters via CLI args.
The
blethrs-link
CRC checksum generation does not yet match the CRCgeneration performed by the STM32F407. This could potentially be solved
by copying the CRC implementation performed by
crcmod
inblethrs.py
.