aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2024-10-26 08:32:30 +0000
committerGitHub <[email protected]>2024-10-26 08:32:30 +0000
commitb31648f2e59a68748e1c0f1408d1658a2e5e6a08 (patch)
tree656ba1ba831adc5bea9221413c7978f644d86445 /docs
parent6bcd05ac830bbeaaa09776a397477ee4022c3499 (diff)
parent3d0921ffc4afb49b5d28277a02cee55fcec08881 (diff)
Merge pull request #3462 from Krensi/patch-2
Updated the Cargo.toml section - Embassy is already available on crates.io
Diffstat (limited to 'docs')
-rw-r--r--docs/pages/new_project.adoc18
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/pages/new_project.adoc b/docs/pages/new_project.adoc
index 821bcbd27..38cea044b 100644
--- a/docs/pages/new_project.adoc
+++ b/docs/pages/new_project.adoc
@@ -73,16 +73,28 @@ Now that cargo knows what target to compile for (and probe-rs knows what chip to
73 73
74Looking in `examples/stm32g4/Cargo.toml`, we can see that the examples require a number of embassy crates. For blinky, we’ll only need three of them: `embassy-stm32`, `embassy-executor` and `embassy-time`. 74Looking in `examples/stm32g4/Cargo.toml`, we can see that the examples require a number of embassy crates. For blinky, we’ll only need three of them: `embassy-stm32`, `embassy-executor` and `embassy-time`.
75 75
76At the time of writing, the latest version of embassy isn‘t available on crates.io, so we need to install it straight from the git repository. The recommended way of doing so is as follows: 76
77At the time of writing, embassy is already published to crates.io. Therefore, dependencies can easily added via Cargo.toml.
78
79[source,toml]
80----
81[dependencies]
82embassy-stm32 = { version = "0.1.0", features = ["defmt", "time-driver-any", "stm32g474re", "memory-x", "unstable-pac", "exti"] }
83embassy-executor = { version = "0.6.1", features = ["nightly", "arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] }
84embassy-time = { version = "0.3.2", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
85----
86
87Prior, embassy needed to be installed straight from the git repository. Installing from git is still useful, if you want to checkout a specic revision of an embassy crate which is not yet published.
88The recommended way of doing so is as follows:
77 89
78* Copy the required `embassy-*` lines from the example `Cargo.toml` 90* Copy the required `embassy-*` lines from the example `Cargo.toml`
79* Make any necessary changes to `features`, e.g. requiring the `stm32g474re` feature of `embassy-stm32` 91* Make any necessary changes to `features`, e.g. requiring the `stm32g474re` feature of `embassy-stm32`
80* Remove the `path = ""` keys in the `embassy-*` entries 92* Remove the `path = ""` keys in the `embassy-*` entries
81* Create a `[patch.crates-io]` section, with entries for each embassy crate we need. These should all contain identical values: a link to the git repository, and a reference to the commit we’re checking out. Assuming you want the latest commit, you can find it by running `git ls-remote https://github.com/embassy-rs/embassy.git HEAD` 93* Create a `[patch.crates-io]` section, with entries for each embassy crate we need. These should all contain identical values: a link to the git repository, and a reference to the commit we’re checking out. Assuming you want the latest commit, you can find it by running `git ls-remote https://github.com/embassy-rs/embassy.git HEAD`
82 94
83NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed. Hopefully this will no longer be necessary once embassy is released on crates.io! 95NOTE: When using this method, it’s necessary that the `version` keys in `[dependencies]` match up with the versions defined in each crate’s `Cargo.toml` in the specificed `rev` under `[patch.crates.io]`. This means that when updating, you have to a pick a new revision, change everything in `[patch.crates.io]` to match it, and then correct any versions under `[dependencies]` which have changed.
84 96
85At the time of writing, this method produces the following results: 97An example Cargo.toml file might look as follows:
86 98
87[source,toml] 99[source,toml]
88---- 100----