diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/modules/ROOT/nav.adoc | 1 | ||||
| -rw-r--r-- | docs/modules/ROOT/pages/faq.adoc | 81 | ||||
| -rw-r--r-- | docs/modules/ROOT/pages/project_structure.adoc | 80 |
3 files changed, 81 insertions, 81 deletions
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 7e178df62..13459099f 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | * xref:getting_started.adoc[Getting started] | 1 | * xref:getting_started.adoc[Getting started] |
| 2 | ** xref:basic_application.adoc[Basic application] | 2 | ** xref:basic_application.adoc[Basic application] |
| 3 | ** xref:project_structure.adoc[Project Structure] | ||
| 3 | * xref:layer_by_layer.adoc[Bare metal to async] | 4 | * xref:layer_by_layer.adoc[Bare metal to async] |
| 4 | * xref:runtime.adoc[Executor] | 5 | * xref:runtime.adoc[Executor] |
| 5 | * xref:hal.adoc[HAL] | 6 | * xref:hal.adoc[HAL] |
diff --git a/docs/modules/ROOT/pages/faq.adoc b/docs/modules/ROOT/pages/faq.adoc index 2d49b68a6..2994c6278 100644 --- a/docs/modules/ROOT/pages/faq.adoc +++ b/docs/modules/ROOT/pages/faq.adoc | |||
| @@ -4,87 +4,6 @@ These are a list of unsorted, commonly asked questions and answers. | |||
| 4 | 4 | ||
| 5 | Please feel free to add items to link:https://github.com/embassy-rs/embassy/edit/main/docs/modules/ROOT/pages/faq.adoc[this page], especially if someone in the chat answered a question for you! | 5 | Please feel free to add items to link:https://github.com/embassy-rs/embassy/edit/main/docs/modules/ROOT/pages/faq.adoc[this page], especially if someone in the chat answered a question for you! |
| 6 | 6 | ||
| 7 | == How do I even start? | ||
| 8 | |||
| 9 | There are many ways to configure embassy and it's components for your exact application. The link:https://github.com/embassy-rs/embassy/tree/main/examples[examples] directory for each chipset demonstrate how your project structure should look. Let's break it down: | ||
| 10 | |||
| 11 | The toplevel file structure of your project should look like this: | ||
| 12 | [source,plain] | ||
| 13 | ---- | ||
| 14 | {} = Maybe | ||
| 15 | |||
| 16 | my-project | ||
| 17 | |- .cargo | ||
| 18 | | |- config.toml | ||
| 19 | |- src | ||
| 20 | | |- main.rs | ||
| 21 | |- build.rs | ||
| 22 | |- Cargo.toml | ||
| 23 | |- {memory.x} | ||
| 24 | |- rust-toolchain.toml | ||
| 25 | ---- | ||
| 26 | |||
| 27 | === .cargo/config.toml | ||
| 28 | |||
| 29 | This directory/file describes what platform you're on, and configures link:https://github.com/probe-rs/probe-rs[probe-rs] to deploy to your device. | ||
| 30 | |||
| 31 | Here is a minimal example: | ||
| 32 | |||
| 33 | [source,toml] | ||
| 34 | ---- | ||
| 35 | [target.thumbv6m-none-eabi] # <-change for your platform | ||
| 36 | runner = 'probe-rs run --chip STM32F031K6Tx' # <- change for your chip | ||
| 37 | |||
| 38 | [build] | ||
| 39 | target = "thumbv6m-none-eabi" # <-change for your platform | ||
| 40 | |||
| 41 | [env] | ||
| 42 | DEFMT_LOG = "trace" # <- can change to info, warn, or error | ||
| 43 | ---- | ||
| 44 | |||
| 45 | === build.rs | ||
| 46 | |||
| 47 | This is the build script for your project. It links defmt (what is defmt?) and the `memory.x` file if need be. This file is pretty specific for each chipset, just copy and paste from the corresponding link:https://github.com/embassy-rs/embassy/tree/main/examples[example]. | ||
| 48 | |||
| 49 | === Cargo.toml | ||
| 50 | |||
| 51 | This is your manifest file, where you can configure all of the embassy components to use the features you need. | ||
| 52 | |||
| 53 | TODO: someone should exhaustively describe every feature for every component! | ||
| 54 | |||
| 55 | === memory.x | ||
| 56 | |||
| 57 | This file outlines the flash/ram usage of your program. It is especially useful when using link:https://github.com/embassy-rs/nrf-softdevice[nrf-softdevice] on an nRF5x. | ||
| 58 | |||
| 59 | Here is an example for using S140 with an nRF52840: | ||
| 60 | |||
| 61 | [source,x] | ||
| 62 | ---- | ||
| 63 | MEMORY | ||
| 64 | { | ||
| 65 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | ||
| 66 | /* These values correspond to the NRF52840 with Softdevices S140 7.0.1 */ | ||
| 67 | FLASH : ORIGIN = 0x00027000, LENGTH = 868K | ||
| 68 | RAM : ORIGIN = 0x20020000, LENGTH = 128K | ||
| 69 | } | ||
| 70 | ---- | ||
| 71 | |||
| 72 | === rust-toolchain.toml | ||
| 73 | |||
| 74 | This file configures the rust version and configuration to use. | ||
| 75 | |||
| 76 | A minimal example: | ||
| 77 | |||
| 78 | [source,toml] | ||
| 79 | ---- | ||
| 80 | [toolchain] | ||
| 81 | channel = "nightly-2023-08-19" # <- as of writing, this is the exact rust version embassy uses | ||
| 82 | components = [ "rust-src", "rustfmt" ] # <- optionally add "llvm-tools-preview" for some extra features like "cargo size" | ||
| 83 | targets = [ | ||
| 84 | "thumbv6m-none-eabi" # <-change for your platform | ||
| 85 | ] | ||
| 86 | ---- | ||
| 87 | |||
| 88 | == How to deploy to RP2040 without a debugging probe. | 7 | == How to deploy to RP2040 without a debugging probe. |
| 89 | 8 | ||
| 90 | Install link:https://github.com/JoNil/elf2uf2-rs[elf2uf2-rs] for converting the generated elf binary into a uf2 file. | 9 | Install link:https://github.com/JoNil/elf2uf2-rs[elf2uf2-rs] for converting the generated elf binary into a uf2 file. |
diff --git a/docs/modules/ROOT/pages/project_structure.adoc b/docs/modules/ROOT/pages/project_structure.adoc new file mode 100644 index 000000000..31417d09c --- /dev/null +++ b/docs/modules/ROOT/pages/project_structure.adoc | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | = Project Structure | ||
| 2 | |||
| 3 | There are many ways to configure embassy and it's components for your exact application. The link:https://github.com/embassy-rs/embassy/tree/main/examples[examples] directory for each chipset demonstrate how your project structure should look. Let's break it down: | ||
| 4 | |||
| 5 | The toplevel file structure of your project should look like this: | ||
| 6 | [source,plain] | ||
| 7 | ---- | ||
| 8 | {} = Maybe | ||
| 9 | |||
| 10 | my-project | ||
| 11 | |- .cargo | ||
| 12 | | |- config.toml | ||
| 13 | |- src | ||
| 14 | | |- main.rs | ||
| 15 | |- build.rs | ||
| 16 | |- Cargo.toml | ||
| 17 | |- {memory.x} | ||
| 18 | |- rust-toolchain.toml | ||
| 19 | ---- | ||
| 20 | |||
| 21 | === .cargo/config.toml | ||
| 22 | |||
| 23 | This directory/file describes what platform you're on, and configures link:https://github.com/probe-rs/probe-rs[probe-rs] to deploy to your device. | ||
| 24 | |||
| 25 | Here is a minimal example: | ||
| 26 | |||
| 27 | [source,toml] | ||
| 28 | ---- | ||
| 29 | [target.thumbv6m-none-eabi] # <-change for your platform | ||
| 30 | runner = 'probe-rs run --chip STM32F031K6Tx' # <- change for your chip | ||
| 31 | |||
| 32 | [build] | ||
| 33 | target = "thumbv6m-none-eabi" # <-change for your platform | ||
| 34 | |||
| 35 | [env] | ||
| 36 | DEFMT_LOG = "trace" # <- can change to info, warn, or error | ||
| 37 | ---- | ||
| 38 | |||
| 39 | === build.rs | ||
| 40 | |||
| 41 | This is the build script for your project. It links defmt (what is defmt?) and the `memory.x` file if need be. This file is pretty specific for each chipset, just copy and paste from the corresponding link:https://github.com/embassy-rs/embassy/tree/main/examples[example]. | ||
| 42 | |||
| 43 | === Cargo.toml | ||
| 44 | |||
| 45 | This is your manifest file, where you can configure all of the embassy components to use the features you need. | ||
| 46 | |||
| 47 | TODO: someone should exhaustively describe every feature for every component! | ||
| 48 | |||
| 49 | === memory.x | ||
| 50 | |||
| 51 | This file outlines the flash/ram usage of your program. It is especially useful when using link:https://github.com/embassy-rs/nrf-softdevice[nrf-softdevice] on an nRF5x. | ||
| 52 | |||
| 53 | Here is an example for using S140 with an nRF52840: | ||
| 54 | |||
| 55 | [source,x] | ||
| 56 | ---- | ||
| 57 | MEMORY | ||
| 58 | { | ||
| 59 | /* NOTE 1 K = 1 KiBi = 1024 bytes */ | ||
| 60 | /* These values correspond to the NRF52840 with Softdevices S140 7.0.1 */ | ||
| 61 | FLASH : ORIGIN = 0x00027000, LENGTH = 868K | ||
| 62 | RAM : ORIGIN = 0x20020000, LENGTH = 128K | ||
| 63 | } | ||
| 64 | ---- | ||
| 65 | |||
| 66 | === rust-toolchain.toml | ||
| 67 | |||
| 68 | This file configures the rust version and configuration to use. | ||
| 69 | |||
| 70 | A minimal example: | ||
| 71 | |||
| 72 | [source,toml] | ||
| 73 | ---- | ||
| 74 | [toolchain] | ||
| 75 | channel = "nightly-2023-08-19" # <- as of writing, this is the exact rust version embassy uses | ||
| 76 | components = [ "rust-src", "rustfmt" ] # <- optionally add "llvm-tools-preview" for some extra features like "cargo size" | ||
| 77 | targets = [ | ||
| 78 | "thumbv6m-none-eabi" # <-change for your platform | ||
| 79 | ] | ||
| 80 | ---- | ||
