Skip to content
This repository has been archived by the owner on Jan 14, 2023. It is now read-only.

Added metadata parsing for flash configuration #31

Merged
merged 3 commits into from
May 17, 2020

Conversation

ryankurte
Copy link
Contributor

@ryankurte ryankurte commented May 16, 2020

Wow this is an unbelievably smooth experience, great work!

This lets you add metadata to your cargo package to specify the cargo-flash chip argument (and should be simple to extend for any other required options), for example:

[package.metadata]
chip = "STM32F429ZITx"

Questions:

  • Are we okay to assume Cargo.toml is in the current directory / is there a better way to do this?
  • Non-critical but, is there a reason the commands are all specified using flags rather than subcommands

@Yatekii
Copy link
Member

Yatekii commented May 16, 2020

Thanks for the kind words! We work hard to improve it even more :)

I like the change very much, thanks for doing this! I didn't even know this was possible, tho in theory it should be possible to put any data into the Cargo.toml.

At the moment we can always assume Cargo.toml is in the current dir. cargo-flash works for crates in a workspace, but only if you are in the actual toplevel dir of the crate, not the workspace. This is a bug in cargo-project, which I didn't find time to fix yet. Also, I didn't find time to port everything to cargo-metadata which should not have this issue :)

What flags would you like to see as subcommands? I cannot really see where this would be useful to be honest. If you mean things like reset etc. cargo-flash is really ment just for flashing with a few additions. Flags like --gdb are to be removed in future releases. The new fat client will be cargo-embed (https://probe.rs/guide/tools/cargo-embed, https://github.com/probe-rs/cargo-embed) which can do everything and allows for make-like task configs :)

Could you please run cargo fmt on your changes, such that the CI is happy? :)

Thanks for your contribution!

@ryankurte
Copy link
Contributor Author

I like the change very much, thanks for doing this! I didn't even know this was possible, tho in theory it should be possible to put any data into the Cargo.toml.

yeah i picked this trick up from cargo-deb, and it's made extremely easy by cargo_toml.

At the moment we can always assume Cargo.toml is in the current dir. cargo-flash works for crates in a workspace...

sweet as

What flags would you like to see as subcommands? I cannot really see where this would be useful to be honest.

yeah fair, i guess it's really only list-chips that is a separate path

Could you please run cargo fmt on your changes, such that the CI is happy? :)

sure, done ^_^

Copy link
Member

@Yatekii Yatekii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great to me! Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants