Skip to content

Cleanup examples #2

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

Closed
TeXitoi opened this issue Dec 13, 2018 · 11 comments
Closed

Cleanup examples #2

TeXitoi opened this issue Dec 13, 2018 · 11 comments

Comments

@TeXitoi
Copy link
Contributor

TeXitoi commented Dec 13, 2018

Maybe we can cleanup examples that doesn't show how to use this crate or test one of this crate functionnality? I think in particular to remove the examples relying on git dependencies.

I don't know if an example using RTFM (once 0.4 is out) is relevant. What do you think?

@therealprof
Copy link
Member

I think we should move out the examples entirely into a stm32f103-examples (sub-)crate or some potentially into their own crates. Anything that lives in the crate itself should would need to work on any MCU in that family (and since that requires a memory.x that would be kind of meh).

@TeXitoi
Copy link
Contributor Author

TeXitoi commented Dec 13, 2018

Having example can be really interesting. For example, to check that binaries still works on PR, of on PR to give something to test on real hardware.

I don't know if we can have more than one configuration on examples, to be able to compile for more than one MCU.

@therealprof
Copy link
Member

Oh, I agree that having code exercising functionality to test for proper compilation would be a nice thing. But the examples here are highly target dependent and need additional hardware to be runnable at all so I'd prefer to have it in board specific repos rather than in the multi-MCU HAL if that makes sense.

@TeXitoi
Copy link
Contributor Author

TeXitoi commented Dec 13, 2018

adding an stm32f103-examples, and build them on std32f1xx's travis?

We'll have to find a way to use the current code with the examples to do that, but it looks like a good solution. It mightl also be tricky with breaking changes.

Another way is to have them in a crate in this repository, with path dependencies

@therealprof
Copy link
Member

adding an stm32f103-examples, and build them on std32f1xx's travis?

Yes, that.

@therealprof
Copy link
Member

Or move it out if it's really more a project in its own.

@TheZoq2
Copy link
Member

TheZoq2 commented Feb 10, 2019

A crate in the repo sounds like a better idea to me, if nothing else it makes the examples easier to find

@burrbull
Copy link
Member

burrbull commented Feb 11, 2019

An idea.
Add cargo generate option --from-example examplename. This will move example into main.rs.

We can store all templates and examples for different microcontrollers in the one repository in different branches (already working) or in different folders.

One crate to rule them all.

@therealprof
Copy link
Member

@burrbull Sorry, but now I'm confused. :-D Which crate is the one to rule them all and who's going to maintain that?

@burrbull
Copy link
Member

cargo generate --git https://github.com/rust-embedded/cortex-m-quickstart --branch stm32f103c8 --from-example blinky
cargo run

@TheZoq2
Copy link
Member

TheZoq2 commented Oct 5, 2020

I think the current example setup works quite well, so 'll close this for now

@TheZoq2 TheZoq2 closed this as completed Oct 5, 2020
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

No branches or pull requests

4 participants