From ccbaea82aa6a55f6774b6eccad975382900f86d9 Mon Sep 17 00:00:00 2001 From: Jonas Jacobsson <01joja@gmail.com> Date: Tue, 27 Sep 2022 15:29:03 +0000 Subject: .toml and note aboute target --- .cargo/config | 13 ------------- .cargo/config.toml | 13 +++++++++++++ book/en/src/by-example.md | 6 ++++++ book/en/src/by-example/app_init.md | 6 ------ 4 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 .cargo/config create mode 100644 .cargo/config.toml diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index d70faef..0000000 --- a/.cargo/config +++ /dev/null @@ -1,13 +0,0 @@ -[alias] -xtask = "run --package xtask --" - -[target.thumbv6m-none-eabi] -runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - -[target.thumbv7m-none-eabi] -runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" - -[target.'cfg(all(target_arch = "arm", target_os = "none"))'] -rustflags = [ - "-C", "link-arg=-Tlink.x", -] \ No newline at end of file diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..d70faef --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,13 @@ +[alias] +xtask = "run --package xtask --" + +[target.thumbv6m-none-eabi] +runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" + +[target.thumbv7m-none-eabi] +runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semihosting-config enable=on,target=native -kernel" + +[target.'cfg(all(target_arch = "arm", target_os = "none"))'] +rustflags = [ + "-C", "link-arg=-Tlink.x", +] \ No newline at end of file diff --git a/book/en/src/by-example.md b/book/en/src/by-example.md index 3a523e5..419a4ba 100644 --- a/book/en/src/by-example.md +++ b/book/en/src/by-example.md @@ -30,3 +30,9 @@ Yields this output: ``` console {{#include ../../../ci/expected/locals.run}} ``` + +> **NOTE**: You can choose target device by passing a target +> triple to cargo (e.g. `cargo run --example init --target thumbv7m-none-eabi`) or +> configure a default target in `.cargo/config.toml`. +> +> For running the examples, we use a Cortex M3 emulated in QEMU, so the target is `thumbv7m-none-eabi`. \ No newline at end of file diff --git a/book/en/src/by-example/app_init.md b/book/en/src/by-example/app_init.md index 615c299..22c4a28 100644 --- a/book/en/src/by-example/app_init.md +++ b/book/en/src/by-example/app_init.md @@ -28,9 +28,3 @@ Running the example will print `init` to the console and then exit the QEMU proc $ cargo run --target thumbv7m-none-eabi --example init {{#include ../../../../ci/expected/init.run}} ``` - -> **NOTE**: You can choose target device by passing a target -> triple to cargo (e.g. `cargo run --example init --target thumbv7m-none-eabi`) or -> configure a default target in `.cargo/config.toml`. -> -> For running the examples, we use a Cortex M3 emulated in QEMU, so the target is `thumbv7m-none-eabi`. -- cgit v1.2.3