From 4b4cb769894a243282908d11d8c834b757062e84 Mon Sep 17 00:00:00 2001 From: Jan Teske Date: Fri, 4 Sep 2020 15:26:18 +0200 Subject: [PATCH] Build codegen with x86_64-unknown-linux-gnu by default --- codegen/.cargo/config | 2 ++ codegen/README.md | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 codegen/.cargo/config diff --git a/codegen/.cargo/config b/codegen/.cargo/config new file mode 100644 index 000000000..2f056549b --- /dev/null +++ b/codegen/.cargo/config @@ -0,0 +1,2 @@ +[build] +target = "x86_64-unknown-linux-gnu" diff --git a/codegen/README.md b/codegen/README.md index a2e016ec5..90f8a58e8 100644 --- a/codegen/README.md +++ b/codegen/README.md @@ -8,17 +8,17 @@ source code of the stm32f3xx-hal crate. For more information on how the STM32CubeMX database is structured, check out the README in the [cube-parse](https://github.com/dbrgn/cube-parse) repository. -Because by default cargo tries to use the `thumbv7em-none-eabihf` target, due -to what's specified in the `.cargo/config`, you need to manually specify your -host's target when building `codegen`, e.g.: +Because by default cargo tries to use the `x86_64-unknown-linux-gnu` target, +when building `codegen`, due to what's specified in the `.cargo/config`, you +need to manually specify your host's target if it differs from that, e.g.: ``` -$ cargo run --target x86_64-unknown-linux-gnu -- help +$ cargo run --target x86_64-apple-darwin -- help ``` `codgen` can generate the following code: -- GPIO mappings +- [GPIO mappings](#gpio-mappings) ## GPIO mappings @@ -30,9 +30,9 @@ is simply a matter of deleting the old ones and then executing: $ cargo run --target $host_target -- gpio $cubemx_db_path >> ../src/gpio.rs ``` -`$cubemx_db_path` must be the path to the `db/mcu` directory under an +`$cubemx_db_path` must be the path to the `db/` directory under an STM32CubeMX installation. With a default Linux install, this would be -`/opt/stm32cubemx/db/mcu`. +`/opt/stm32cubemx/db`. The generated `gpio!` invocations are gated by features whose names are derived from the respective GPIO internal peripheral (IP) version: